marshmallow-code / marshmallow-code/apispec
Support nested schema inside object properties
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 202
- Avg merge
- 3h 38m
- Merged PRs (30d)
- 3
Description
Hi. Maybe I missed, I'm trying to nest a schema to object type `properties`, but I couldn't found the way to solve this situation.
``` yaml
responses:
200:
content:
application/json:
schema:
type: object
properties:
addressInfo:
$ref: "#/components/schemas/AddressInfo"
description: Address info.
```
First I wrote below, but it doesn't work.
``` yaml
schema:
type: object
properties:
addressInfo:
$ref: AddressInfo
description: Address info.
```
This is one of options, but it can't declare `description`
``` yaml
schema:
type: object
properties:
addressInfo: AddressInfo
# description?
```
manual binding is not working because **AddressInfo** is not in **#/components/schema**
``` yaml
schema:
type: object
properties:
addressInfo:
$ref: "#/components/schemas/AddressInfo" # not defined.
description: Address info.
```
Is there a proper solution for this? 🙏 Thanks.
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 how the YAML response schema, object properties, and #/components/schemas references are represented and resolved. Check whether the current OpenAPI generation path supports a referenced nested schema with a property description; done means producing valid output for the AddressInfo example while preserving the nested reference and description, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100