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

Response of content type '*/*' does not resolve properly #52

Open
njbair opened this issue Sep 10, 2024 · 0 comments
Open

Response of content type '*/*' does not resolve properly #52

njbair opened this issue Sep 10, 2024 · 0 comments

Comments

@njbair
Copy link

njbair commented Sep 10, 2024

Given the minimal example YAML below, note how the generated schema includes response: unknown. After some testing, I determined this only happens when the content type is '*/*'. If I change it to application/json, it works fine.

openapi: 3.0.3
info:
  title: Test API Spec
  version: 1.0.0
components:
  schemas:
    Response:
      properties:
        id:
          type: integer
        name:
          type: string
      type: object
paths:
  /test:
    get:
      operationId: getTest
      responses:
        '200':
          content:
            '*/*':
              schema:
                items:
                  $ref: '#/components/schemas/Response'
                type: array
servers:
  - url: https://api.example.com

...this produces a response of type unknown:

  export type get_GetTest = {
    method: "GET";
    path: "/test";
    requestFormat: "json";
    parameters: never;
    response: unknown;
  };

Originally posted by @njbair in #51 (comment)

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

No branches or pull requests

1 participant