Skip to content

Resolve an array of schema objects in parameters #209

@cvlong

Description

@cvlong

I see that the marshmallow plugin currently resolves an array of schema items in the response, but is there existing functionality to also do this in the request?

I'd like to be able to define my request parameters a docstring like this:

spec.definition('Schema', schema=Schema)

def example():
    """Example view that accepts an array objects 
    ---
    post:
        parameters:
            - in: body
              schema:
                type: array
                items: Schema
    """

So that ['parameters'][0]['schema'] will produce more explicit results like {'type': 'array', 'items': {'$ref': '#/definitions/Schema'}} rather than {'type': 'array', 'items': 'Schema'}.

Does this functionality already exist? If not, I am happy to submit a PR to address this. Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions