Partial request sample with nested discriminator
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
When the discriminator isn't at the top level, the request sample doesn't show all fields.
Example:
In the default pet store, in the POST /pet, we see that huntingSkill is present, a specific field from petType=Cat
{
"id": 0,
"category": {
"id": 0,
"name": "string",
"sub": {
"prop1": "string"
}
},
"name": "Guru",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available",
"petType": "Cat",
"huntingSkill": "lazy"
}
Nesting the petType from line 107 like this, for example:
-$ref: '#/definitions/Pet'
+type: object
+properties:
+ foo:
+ $ref: '#/definitions/Pet'
We don't get the huntingSkill in the request sample:
{
"foo": {
"id": 0,
"category": {
"id": 0,
"name": "string",
"sub": {
"prop1": "string"
}
},
"name": "Guru",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available",
"petType": "string"
}
}
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
Reproduce the request sample with the default pet store and the nested schema change shown around demo/swagger.yaml line 107. Inspect the request-sample generation entry point to determine why the nested discriminator loses the Cat-specific field; done means the nested example includes huntingSkill while preserving the surrounding fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100