Skip to content

POST with query-params and body #143

Open
@AbdealiLoKo

Description

@AbdealiLoKo

I seem to be unable to create a swagger with a schema for the body and also a query param.

I tried:

@use_kwargs({'dataField1': fields.Str()}, locations=('body',))
@use_kwargs({'qParam1': fields.Str()}, locations=('query',))

But this seems to be returning:

"post": {
        "parameters": [
          {
            "in": "body", 
            "name": "body", 
            "required": false, 
            "schema": {
              "properties": {
                "dataField1": {
                  "type": "string"
                }, 
                "qParam1": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          }
        ], 

I also tried:

@use_kwargs({'qParam1': fields.Str()}, locations=('query',))
@doc(params={'body': {
            'in': 'body',
            'name': 'body',
            'schema': {'type': 'object', 'properties': {
                'dataField1': {'type': 'string'},
            }},
         }},

and:

@use_kwargs({'qParam1': fields.Str()}, locations=('query',))
@doc(params={'dataField1': {
            'in': 'body',
            'name': 'dataField1',
            'type': 'string',
         }},

But I can't seem to figure this out ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions