Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code generation: a lot of issues with generating Go code for https://demo.thingsboard.io/v3/api-docs?group=thingsboard #1116

Open
ardrabczyk opened this issue Nov 27, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ardrabczyk
Copy link

What version of ogen are you using?

$ go list -m github.com/ogen-go/ogen
github.com/ogen-go/ogen

I compiled it from tip of today's main:

$ git describe --always
78b0432b

Can this issue be reproduced with the latest version?

Yes

What did you do?

$ ./ogen 'https://demo.thingsboard.io/v3/api-docs?group=thingsboard'

Schema: https://demo.thingsboard.io/swagger-ui/#/

What did you expect to see?

Generated Go code.

What did you see instead?

First I get:

$ ./ogen 'https://demo.thingsboard.io/v3/api-docs?group=thingsboard'
  - api-docs:1:1418220 -> invalid name: "PageData«EntityVersion»" doesn't match "^[a-zA-Z0-9.\\-_]+$"

After commenting

if err := validateComponentsKeys(p, c); err != nil {
        return nil, err
}

I get:

- api-docs:1:1085604 -> parse path "/api/2fa/account/config/generate{?providerType}": path MUST NOT contain a query string

After commenting

case u.RawQuery != "":
        return nil, errors.New("path MUST NOT contain a query string")

I get:

- api-docs:1:1086888 -> parameter "?providerType" not specified

Is there something wrong with this spec https://demo.thingsboard.io/swagger-ui/#/?

@ardrabczyk ardrabczyk added the bug Something isn't working label Nov 27, 2023
@ardrabczyk
Copy link
Author

@tdakkota
Copy link
Member

/api/2fa/account/config/generate{?providerType} is definitely wrong path template, query paramters should be described in the parameters section.

@asv
Copy link

asv commented Dec 1, 2023

@ardrabczyk Try validating your specification using https://github.com/daveshanley/vacuum before calling ogen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants