Same name for all models defined inline for responses
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Problem:
For paths with more than one inline response schema defined, names for all models are generated the same.
Eg:
/pets:
post:
summary: Create pets
operationId: createPets
tags:
- pets
requestBody:
description: 'Create pets'
content:
application/json:
schema:
type: array
items:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tags:
type: array
items:
type: string
required: true
responses:
'200':
description: list of pets created
content:
application/json:
schema:
type: array
items:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tags:
type: array
items:
type: string
default:
description: unexpected error
content:
application/json:
schema:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
In this path above, two models for responses are generated - one of type kotlin.collections.List<ShowByPetIdResponse> and another of type ShowByPetIdResponse.
Tech notes:
Currently the only mandatory field which can help us differentiate responses are the http statuses(200, 300..etc) or default.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the response-schema model-name generation for the two inline response schemas shown in the issue. Compare the generated names for the 200 response and the default response, then make completion mean that each response model receives a distinct name based on its HTTP status or default designation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin, openapi
- Domain
- backend-api-design, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100