Open d9k opened 1 year ago
exceprts from openapi.yaml
:
# . . . . .
paths:
/courses:
post:
tags:
- Courses
summary: create course
parameters: []
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/courses_body'
responses:
"201":
description: created
content:
application/json:
schema:
$ref: '#/components/schemas/course_serialized_item'
"422":
description: unprocessable_entity
# . . . . .
components:
schemas:
# . . . . .
course_serialized_item:
type: object
properties:
id:
type: integer
status:
type: string
created_at:
type: string
format: date-time
nullable: true
updated_at:
type: string
format: date-time
nullable: true
context_id:
type: integer
source_file_id:
type: string
nullable: true
start_resource_id:
type: integer
nullable: true
courses_body:
required:
- context_id
- source_file_id
type: object
properties:
source_file_id:
type: string
description: GUID from FilesSerivce
context_id:
type: integer
https://swagger.io/docs/specification/paths-and-operations/
operationId is an optional unique string used to identify an operation.
It seems you break swagger standart because you require an operationId
.
Under responses, each response definition starts with a status code, such as 200 or 404. An operation typically returns one successful status code and one or more error statuses.
I believe the swagger documentation doesn't say that you must provide HTTP 200
code response;
Yes, I need the operationId as you said.
I also think that only 200 codes of HTTP response code do not exist.
Thanks for your project, honored @Ryan-Sin! The swagger-nestjs-codegen
code is pretty well-written, that was easy to alter it in most cases.