Skip to content

Missing the value of 'deprecated' field #697

@ackintosh

Description

@ackintosh

Example json in OAS v2:

{
    "swagger": "2.0",
    "info": {
        "version": "1.0",
        "title": "x-example"
    },
    "host": "httpbin.org",
    "basePath": "/anything",
    "schemes": [
        "http"
    ],
    "paths": {
        "/{foo}": {
            "get": {
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                },
                "deprecated": false
            }
        }
    }
}

In case of deprecated: false like above or the field is omitted, Operation.getDeprecated() returns null.
I think Operation.getDeprecated() should return false in that case. There is the same issue in OAS v3.

I'll submit a PR that fixes this issue.

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