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

Example with null #415

Closed
juanitobebe opened this issue Feb 13, 2018 · 7 comments
Closed

Example with null #415

juanitobebe opened this issue Feb 13, 2018 · 7 comments

Comments

@juanitobebe
Copy link

Hello,

I have a problem expressing in an example that a property should be null, see:
image

In the yaml the property is defined as:

          previous_page:
             type: number
             x-nullable: true
             description: 'The previous page number.This value is null if there is no previous page to show.'
             example: null

We thought that including x-nullable: true should be enough.

Is there a workaround for this when using Swagger 2.0 and ReDoc 1.2?

I'll be glad to make that small change in the example renderer if it's needed, I just need someone to shed some light on me.

@CesarLanderos
Copy link
Contributor

🙏

@RomanHotsiy
Copy link
Member

Hey @juanitobebe,
This was an issue of openapi-sampler dependency which is used in ReDoc. The issue is already fixed in the latest version v1.0.0-beta.8 of the sampler so I just updated the dep.

I will release a new patch release 1.20.1 on weekends!

@juanitobebe
Copy link
Author

Thanks this is great!
We've also been taking a look to 2.0 alpha. It's really good!

@RomanHotsiy
Copy link
Member

1.21.0 has been released

@FoxInFlame
Copy link

This issue still persists with OpenAPI 3.0. I have a string property where I set nullable to true, and example to null, yet the ReDoc documentation example shows "string".

@AraConnect
Copy link

This issue still persists with OpenAPI 3.0. I have a string property where I set nullable to true, and example to null, yet the ReDoc documentation example shows "string".

That's true

@ngthtung
Copy link

Any updates?

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

6 participants