Skip to content

Fails to load due to null http operations in spec file #268

@csuich2

Description

@csuich2

If a spec contains null http operations, Swagger UI fails to load due to missing null checks in two places:

Uncaught TypeError: Cannot read property 'parameters' of null (swagger-client.js:332)
Uncaught TypeError: Cannot read property 'tags' of null (swagger-client.js:686)

I came across this issue as my API is build & served with Jersey/JAX-RS and our serialization strategy includes serializing nulls.

I have identified a fix and will submit a PR shortly.

...
paths: {
  "/myapi": {
    "get": { ... },
    "put": { ... },
    "post": null,
    "delete": null,
    ...
  }
}

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