Skip to content

fix: Fix no required body in types#7

Merged
crutch12 merged 3 commits into
mainfrom
feature/Fix-no-required-body
Jul 22, 2025
Merged

fix: Fix no required body in types#7
crutch12 merged 3 commits into
mainfrom
feature/Fix-no-required-body

Conversation

@Denwa799
Copy link
Copy Markdown

@Denwa799 Denwa799 commented Jul 17, 2025

There was an error where it was impossible to pass an object to the request body if it was not required by the schema. Error where you can't assign anything to undefined

requestBody?: {
            content: {
                "application/json": components["schemas"]["Pet"];
                "application/xml": components["schemas"]["Pet"];
                "application/x-www-form-urlencoded": components["schemas"]["Pet"];
            };
        };
post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: Add a new pet to the store
      operationId: addPet
      requestBody:
        description: Create a new pet in the store
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
          application/xml:
            schema:
              $ref: "#/components/schemas/Pet"
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/Pet"
        required: false

@Denwa799 Denwa799 force-pushed the feature/Fix-no-required-body branch from 820fd97 to 6f49eb8 Compare July 17, 2025 11:35
@Denwa799 Denwa799 force-pushed the feature/Fix-no-required-body branch from 6f49eb8 to 3038475 Compare July 17, 2025 11:37
@crutch12 crutch12 merged commit 2b0a45b into main Jul 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants