[go: up one dir, main page]

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

Version is a required field in info #87

Closed
dbanty opened this issue Nov 15, 2021 · 2 comments
Closed

Version is a required field in info #87

dbanty opened this issue Nov 15, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dbanty
Copy link
Contributor
dbanty commented Nov 15, 2021

Expected Behavior

"version" is required by the library or filled in automatically in order to comply with this part of the spec.

Perhaps OpenApiService::new could required this and title (also required) as parameters? Though that'd be a breaking change which you may want to avoid. You could also make the builder return a Result to check for required params at startup, but that is also a breaking change.

The examples should also probably include version, perhaps using a macro to include the Cargo.toml version (I think this is possible and is probably what I'll do eventually).

Actual Behavior

"version" can be omitted (as it is in the examples I followed) which can lead to validation errors in other tools.

Steps to Reproduce the Problem

Omit the .version() method in setting up OpenApiService and observe that the generated document does not contain a version field under info.

Specifications

[dependencies]
poem = { version = "1.0.24", features = ["multipart", "tempfile"] }
poem-openapi = "1.0.20"
@dbanty dbanty added the bug Something isn't working label Nov 15, 2021
@sunli829
Copy link
Collaborator

I will add the version and title parameters to OpenApiService::new, although this is a breaking change. 🙂

@sunli829
Copy link
Collaborator

Fixed in v1.0.27. 😁

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

2 participants