Skip to content

Confusion around null values in spec and schema #297

@csuich2

Description

@csuich2

See this topic for context: swagger-api/swagger-js#268

When I discovered those exceptions in swagger-js, I initially thought it was just an issue of error handling in the JS. During that discussion, I was informed that the Swagger spec and schema technically do not support null values for some fields (get, post, put, operations, for example).

I just wanted to provide a little feedback as a new user that this was both a bit surprising and confusing. I tried reading through both the spec and schema to determine whether my APIs behavior of serializing null values contradicted the Swagger spec or schema but couldn't find anything that indicated either way.

All that said, I'm hoping someone can explain the decision to explicitly disallow null values for these types of fields. Serializing null values from APIs seems like something that isn't uncommon and not supporting that was just a bit surprising.

Thanks!
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions