openapi-codegen-ts icon indicating copy to clipboard operation
openapi-codegen-ts copied to clipboard

feat: 3xx as success response code

Open infantesimone opened this issue 3 years ago • 1 comments
trafficstars

Description

  • add response decoder generation for response with http status code 3xx, like this:
      /test-redirect-response-header:
        post:
          operationId: "testRedirectResponseHeader"
          responses:
            "302":
              description: "redirect to location"
              headers:
                Location:
                  type: string
            "500":
              description: "Fatal error"    
    

Motivation and Context

The purpose of this PR is to generate response decoders also for 3xx responses. Before this PR, trying to generate a ts client for this openapi we found the lack of a response decoder for the 302 with relative error.

How Has This Been Tested?

  • yarn test
  • yarn e2e

Screenshots (if appropriate):

Types of changes

  • [ ] Chore (improvement with no change in the behaviour)
  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.

infantesimone avatar Nov 02 '22 17:11 infantesimone

Warnings
:warning:

Please include a Pivotal story at the beginning of the PR title (see below).

Example of PR titles that include pivotal stories:

  • single story: [#123456] my PR title
  • multiple stories: [#123456,#123457,#123458] my PR title

Generated by :no_entry_sign: dangerJS

pagopa-github-bot avatar Nov 02 '22 17:11 pagopa-github-bot