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

[SUBJECT]: [DESCRIPTION] #1231

Open
deitch opened this issue Apr 30, 2024 · 0 comments
Open

[SUBJECT]: [DESCRIPTION] #1231

deitch opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@deitch
Copy link

deitch commented Apr 30, 2024

What version of ogen are you using?

$ ogen --version
ogen version v1.1.1-0.20240428023010-b41f78c97d17 (built with go1.21.5) darwin/arm64

Can this issue be reproduced with the latest version?

Yes

What did you do?

  1. Take the sample petstore.yaml
  2. Remove all of the paths. I can do this by eliminating the paths: section entirely (compliant with openapi 3.1 IIRC), or by replacing it with paths: {}
  3. ogen ./petstore.yaml

What did you expect to see?

Defined types

What did you see instead?

The oas_schemas_gen.go file is essentially empty:

// Code generated by ogen, DO NOT EDIT.

package api

Additional helpful information

I think this actually may comply with the spec, which says:

All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.

However, this makes it difficult to define reusable components. For example, I might want to hold my schemas in one file schemas.yaml, and then reference that file from different openapi implementations.

I might even use just the schemas.yaml alone as a way to describe reusable content from which I can generate go code and rust and js etc.

Note: This might not actually be a "bug", based on the above, but it seemed to fit the options most closely. If I erred, please feel free to recategorize.

@deitch deitch added the bug Something isn't working label Apr 30, 2024
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

1 participant