You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I write component object of OAS3 to external file.
I execute validate command for OAS3 file, but the following error occured.
Errors:
-attribute paths.'/pets'(post).responses.default.content.schema.#/components/schemas/Error is missing
-attribute paths.'/pets/{petId}'(get).responses.200.content.schema.#/components/schemas/Pets is missing
-attribute components.$ref is unexpected
-attribute paths.'/pets'(get).responses.default.content.schema.#/components/schemas/Error is missing
-attribute paths.'/pets'(get).responses.200.content.schema.#/components/schemas/Pets is missing
-attribute paths.'/pets/{petId}'(get).responses.default.content.schema.#/components/schemas/Error is missing
openapi-generator version
v 4.0.3
OpenAPI declaration file content or url
petstore-parent.yaml
openapi: "3.0.0"info:
version: 1.0.0title: Swagger Petstorelicense:
name: MITservers:
- url: http://petstore.swagger.io/v1paths:
/pets:
get:
summary: List all petsoperationId: listPetstags:
- petsparameters:
- name: limitin: querydescription: How many items to return at one time (max 100)required: falseschema:
type: integerformat: int32responses:
'200':
description: A paged array of petsheaders:
x-next:
description: A link to the next page of responsesschema:
type: stringcontent:
application/json:
schema:
$ref: "#/components/schemas/Pets"default:
description: unexpected errorcontent:
application/json:
schema:
$ref: "#/components/schemas/Error"post:
summary: Create a petoperationId: createPetstags:
- petsresponses:
'201':
description: Null responsedefault:
description: unexpected errorcontent:
application/json:
schema:
$ref: "#/components/schemas/Error"/pets/{petId}:
get:
summary: Info for a specific petoperationId: showPetByIdtags:
- animalsparameters:
- name: petIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: stringresponses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: "#/components/schemas/Pets"default:
description: unexpected errorcontent:
application/json:
schema:
$ref: "#/components/schemas/Error"components:
$ref: "./petstore-child.yaml"
The following yaml file is valid according to validate command of OpenAPI Generator.
Why did no error occur ?
petstore-parent.yaml
openapi: "3.0.0"info:
version: 1.0.0title: Swagger Petstorelicense:
name: MITservers:
- url: http://petstore.swagger.io/v1paths:
/pets:
get:
summary: List all petsoperationId: listPetstags:
- petsparameters:
- name: limitin: querydescription: How many items to return at one time (max 100)required: falseschema:
type: integerformat: int32responses:
'200':
description: A paged array of petsheaders:
x-next:
description: A link to the next page of responsesschema:
type: stringcontent:
application/json:
schema:
$ref: "./petstore_child.yaml#/components/schemas/Pets"default:
description: unexpected errorcontent:
application/json:
schema:
$ref: "./petstore_child.yaml#/components/schemas/Error"post:
summary: Create a petoperationId: createPetstags:
- petsresponses:
'201':
description: Null responsedefault:
description: unexpected errorcontent:
application/json:
schema:
$ref: "./petstore_child.yaml#/components/schemas/Error"/pets/{petId}:
get:
summary: Info for a specific petoperationId: showPetByIdtags:
- animalsparameters:
- name: petIdin: pathrequired: truedescription: The id of the pet to retrieveschema:
type: stringresponses:
'200':
description: Expected response to a valid requestcontent:
application/json:
schema:
$ref: "./petstore_child.yaml#/components/schemas/Pets"default:
description: unexpected errorcontent:
application/json:
schema:
$ref: "./petstore_child.yaml#/components/schemas/Error"
Bug Report Checklist
Description
I write
component
object of OAS3 to external file.I execute validate command for OAS3 file, but the following error occured.
openapi-generator version
v 4.0.3
OpenAPI declaration file content or url
petstore-parent.yaml
petstore-child.yaml
Command line used for generation
Question
Why did the error occur?
ReDoc can start HTTP server from above yaml file.
Are above yaml file correct as OAS3?
Extra
The following yaml file is valid according to validate command of OpenAPI Generator.
Why did no error occur ?
petstore-parent.yaml
petstore-child.yaml
By the way I issued to OAI/OpenAPI-Specification#1972 .
The text was updated successfully, but these errors were encountered: