Skip to content
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

[BUG] POST response 201 type is always dynamic even if defined #569

Closed
mdrideout opened this issue Mar 10, 2023 · 1 comment
Closed

[BUG] POST response 201 type is always dynamic even if defined #569

mdrideout opened this issue Mar 10, 2023 · 1 comment
Assignees
Labels
bug Something isn't working Triage needed

Comments

@mdrideout
Copy link

This is an issue with the 201 response for POST requests.

Similar to issue #527

The YAML below creates a dart function with the return types and parameters:

Future<Response<dynamic>> postPost({required PostCreateInputType? body})

Which should be

Future<Response<String>> postPost({required PostCreateInputType? body})

... Or a generated type for application/json:.

  "/post":
    post:
      tags:
        - post
      summary: Create a new post
      description: ""
      requestBody:
        $ref: "#/components/requestBodies/PostCreateInputType"
      responses:
        "201":
          description: Created post with ID
          content:
            text/plain:
              example: 923ndwifdfv8723koe29

Library version used:
swagger_dart_code_generator: ^2.10.2

@mdrideout mdrideout added bug Something isn't working Triage needed labels Mar 10, 2023
@Vovanella95
Copy link
Collaborator

Hi @mdrideout , please share valid swagger file with 'application/json' etc...
Without these details, I can not guess what bad happens during generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triage needed
Projects
None yet
Development

No branches or pull requests

3 participants