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] typescript-axios not handling response headers #12403

Open
DavidBiesack opened this issue May 19, 2022 · 0 comments
Open

[BUG] typescript-axios not handling response headers #12403

DavidBiesack opened this issue May 19, 2022 · 0 comments

Comments

@DavidBiesack
Copy link
Contributor

Description

tool either throws an error about response parameters (5.4.0), or silently ignores them (6.0.0)

openapi-generator version

5.4.0 emits an error
6.0.0 does not show an error, but there is no code to handle the Retry-After response header or constrain its type (to string)

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: Header Ref
  description: Demonstrate defect with a $ref to a response header
  version: 0.0.1
servers:
  - url: /issues
paths:
  /status:
    get:
      operationId: getStatus
      description: Get status
      responses:
        '202':
          description: Accepted.
          content:
            text/plain:
              schema:
                type: string
          headers:
            Retry-After:
              $ref: '#/components/headers/Retry-After'
components:
  headers:
    Retry-After:
      description: >-
        See [RFC7231: Retry-After](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3)
      schema:
        type: string
Generation Details
openapi-generator-cli generate -g typescript-axios -i openapi.yaml -o sdk
Steps to reproduce

above command

for 5.4.0 I get

[main] ERROR o.o.codegen.DefaultCodegen - Not handling class Parameter {
    name: Retry-After
    in: header
    description: null
    required: null
    deprecated: null
    allowEmptyValue: null
    style: null
    explode: null
    allowReserved: null
    schema: null
    examples: null
    example: null
    content: null
    $ref: null
} as Body Parameter at the moment

for 6.0.0 the tool does not emit this ERROR but the emitted code does not support that response header.

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

No branches or pull requests

1 participant