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

null as an example of nullable field #62

Open
zlodes opened this issue Feb 8, 2022 · 0 comments
Open

null as an example of nullable field #62

zlodes opened this issue Feb 8, 2022 · 0 comments

Comments

@zlodes
Copy link
Contributor

zlodes commented Feb 8, 2022

If I try to set null as an example of some field, it will be ignored.

Example:

Schema::string('foo')
    ->nullable()
    ->example(null),

It will look like this:

"foo": {
    "type": "string",
    "nullable": true
},

But expected:

"foo": {
    "type": "string",
    "nullable": true,
    "example": null
},

It will be correctly rendered using SwaggerUI or Redoc.

image

@zlodes zlodes changed the title null as a example of nullable field null as an example of nullable field Feb 8, 2022
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

1 participant