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 value #1361

Closed
jdeboer-geoplan opened this issue Nov 7, 2019 · 1 comment
Closed

Example with null value #1361

jdeboer-geoplan opened this issue Nov 7, 2019 · 1 comment
Labels
p3 Low priority

Comments

@jdeboer-geoplan
Copy link

Feature Request:

I think this is a feature request as I don't think there is a way of doing this.

I would like

    /// <summary>
    /// blah blah blah
    /// </summary>
    /// <example>null</example>
    public int? NullableInt{ get; set; }

to produce:

      "nullableInt": {
        "type": "integer",
        "description": "blah blah blah",
        "format": "int32",
        "nullable": true,
        "example": null
      },

At the moment it does not produce an example and the swaggerUI gives it a 0.

I've got round this by implementing an ISchemaFilter based on XmlCommentsSchemaFilter which looks for the word "null" and sets the example to OpenApiNull(), but I wonder if this'd be good to have in the real XmlCommentsSchemaFilter or if I've missed something obvious to avoid having to do this.

@domaindrivendev domaindrivendev added this to the Backlog milestone Nov 11, 2019
@domaindrivendev domaindrivendev added p2 Medium priority p3 Low priority and removed p2 Medium priority labels Jan 17, 2021
@domaindrivendev domaindrivendev removed this from the Backlog milestone Jan 17, 2021
@domaindrivendev
Copy link
Owner

domaindrivendev commented Aug 2, 2021

Fixed by #2151. Released with v6.1.5.

@domaindrivendev domaindrivendev removed this from the vNext milestone Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3 Low priority
Projects
None yet
Development

No branches or pull requests

2 participants