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

pb33f/libopenapi does not support nullable attribute #876

Closed
h6ah4i opened this issue Apr 15, 2024 · 6 comments
Closed

pb33f/libopenapi does not support nullable attribute #876

h6ah4i opened this issue Apr 15, 2024 · 6 comments
Assignees

Comments

@h6ah4i
Copy link
Contributor

h6ah4i commented Apr 15, 2024

Hi. I noticed an issue that blocks me to use runn v0.100 or newer. Recent versions of runn use pb33f/libopenapi-validator for validating API requests and responses. The library has an issue that does not support nullable property. Unfortunately, the author of libopenapi gave up to support them due to relying its validation feature is depends on third-party library...

ref.) pb33f/libopenapi#265 nullable: true for response validation

@k1LoW k1LoW self-assigned this Apr 15, 2024
@k1LoW
Copy link
Owner

k1LoW commented Apr 15, 2024

@h6ah4i Thank you for your report!

@k1LoW
Copy link
Owner

k1LoW commented Apr 15, 2024

In v0.103.2, nullable attributes for request and response are now supported.

Try it out if you like 👍

@h6ah4i
Copy link
Contributor Author

h6ah4i commented Apr 15, 2024

Thank you for the rapid response!

However, the workaround introduced in v0.103.2 did not helped me in my setup unfortunately. It seems the current workaround only support very basic syntax of OpenAPI, so it did not work for schema files using [allOf] (and maybe oneOf and anyOf) syntax(es).

Could you take a look at the following code that I have added some test cases into the http validator test.go.

9733276

@k1LoW
Copy link
Owner

k1LoW commented Apr 16, 2024

In v0.103.3, I fixed it to pass the test you added. Thank you!

@h6ah4i
Copy link
Contributor Author

h6ah4i commented Apr 16, 2024

@k1LoW Thank you so much! It seems like the validation failure caused by the nullable attribute has been gone for me in v0.103.3.

Still, I get many OpenAPI validation errors in v0.100.0+, so I have reported two new issues.

@k1LoW
Copy link
Owner

k1LoW commented Apr 16, 2024

Thank you!!

@k1LoW k1LoW closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants