Skip to content

The request body in specification with application/vnd.api+json don't generate json option for request #592

Closed
@penja

Description

@penja

Describe the bug
The request body in specification with application/vnd.api+json don't generate json request paramers

To Reproduce
Steps to reproduce the behavior:

  1. Example request body
requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/WorkspaceDocument'
  1. generate specification
  2. see in models
def sync_detailed(
    workspace: str,
    *,
    client: Client,
) -> Response[Union[Any, WorkspaceDocument]]:
    """Update a Workspace

    Args:
        workspace (str):

    Returns:
        Response[Union[Any, WorkspaceDocument]]
    """

    kwargs = _get_kwargs(
        workspace=workspace,
        client=client,
    )

    response = httpx.request(
        verify=client.verify_ssl,
        **kwargs,
    )

    return _build_response(response=response)

Expected behavior
request body with application/vnd.api+json
should generate code like belowe

def sync_detailed(
    workspace: str,
    *,
    client: Client,
    json_body: WorkspaceDocument,
) -> Response[Union[Any, WorkspaceDocument]]:
    """Update a Workspace

    Args:
        workspace (str):
        json_body (WorkspaceDocument): JSON:API Document.

            see: https://jsonapi.org/format/#document-structure

    Returns:
        Response[Union[Any, WorkspaceDocument]]
    """

    kwargs = _get_kwargs(
        workspace=workspace,
        client=client,
        json_body=json_body,
    )

    response = httpx.request(
        verify=client.verify_ssl,
        **kwargs,
    )

    return _build_response(response=response)

Desktop (please complete the following information):

  • OS: [e.g. macOS 10.15.1]
  • Python Version: [e.g. 3.8.0]
  • openapi-python-client version [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions