Skip to content

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

Closed

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.

Activity

  1. added
    🐞bug
    on Mar 8, 2022
  2. dbanty commented on Jul 8, 2023

    @dbanty
    Collaborator

    application/vnd.api+json support was explicitly added in 0.8.0 via #307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions