Closed
Description
According to the OpenAPI/Swagger documentation, the version field in the API definition is mandatory. However, when parsing an API definition that does not include the version field, the Swagger parser does not throw any error or warning.
Steps to Reproduce:
- Use the Swagger Parser library to parse the following API definition:
swagger: "2.0"
info:
title: Test API
version: # Missing version field
paths:
/:
get:
summary: List API versions
produces:
- application/json
responses:
"200":
description: Successful response
"300":
description: Multiple choices response
/v2:
get:
summary: Show API version details
produces:
- application/json
responses:
"200":
description: Successful response
"203":
description: Non-authoritative information
consumes:
- application/json
- Observe that the parser does not report any validation errors or warnings.
Expected Behavior:
The parser should throw an error or at least a warning indicating that the version field is missing since it is mandatory.
Actual Behavior:
the missing version field in info should trigger a validation error, but it does not.
Metadata
Metadata
Assignees
Labels
No labels