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

OpenAPI 3.1 support has a bug w/ nullable types #950

Open
jasikpark opened this issue Sep 6, 2024 · 2 comments
Open

OpenAPI 3.1 support has a bug w/ nullable types #950

jasikpark opened this issue Sep 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jasikpark
Copy link

jasikpark commented Sep 6, 2024

Describe the bug

As mentioned in #410 (comment), when using this plugin with an OpenAPI 3.1 schema that uses [string, null] as a list of valid types for a property, instead of showing the enum of types, it joins the array together with no spaces.

Expected behavior

Show a "nullable" tag for the property or just list the valid property types.

For example of the usage, see https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0 and "Swap nullable for type arrays"

Another example of this valid usage in OpenAPI 3.1: OAI/OpenAPI-Specification#3148

Current behavior

The list of valid property types are joined into a string with no spaces.

Possible solution

Steps to reproduce

  1. Create an OpenAPI 3.1 schema that has a property with type [string, null]
  2. Render API docs with the plugin

Screenshots

Context

Trying to keep up-to-date with the current OpenAPI schema while providing clear, useful, and accurate api docs to our users.

Your Environment

@jasikpark jasikpark added the bug Something isn't working label Sep 6, 2024
@sserrata
Copy link
Member

Hi @jasikpark, not sure this is a bug given that 3.1 support is, officially, currently limited. That said, I think we can add support for this new syntax, i.e. type arrays.

@jasikpark
Copy link
Author

That'd be great 💜

I guess my thought is presuming that the desire is to move towards better 3.1 support incrementally, therefore any issues with 3.1 support are bugs? Therefore this is a bug.

Another way to think is that "3.1 support is limited, so therefore any issues with the code are acceptable issues that aren't being prioritized right now", which I get but would be disappointed to hear about. And therefore this would be acceptable behavior and not a bug.

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