Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
penja opened this issue Mar 8, 2022 · 1 comment
Labels
🐞bug Something isn't working

Comments

@penja
Copy link

penja commented Mar 8, 2022

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.

@penja penja added the 🐞bug Something isn't working label Mar 8, 2022
@dbanty
Copy link
Collaborator

dbanty commented Jul 8, 2023

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

@dbanty dbanty closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants