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

Missing "default" response models when using "whitelisted-paths" #763

Open
infira opened this issue Oct 9, 2023 · 0 comments
Open

Missing "default" response models when using "whitelisted-paths" #763

infira opened this issue Oct 9, 2023 · 0 comments
Labels

Comments

@infira
Copy link

infira commented Oct 9, 2023

When using "whitelisted-paths" in options then default response Models are not generated.
For reproducing this bug i made

openapi: 3.0.3
info:
  title: jane-php-generator
  version: v1
servers:
  - url: https://api.example.com
paths:
  /post/data:
    post:
      summary: create authorization token
      tags:
        - token
      operationId: createToken
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                property:
                  type: string
                  description: an identifier unique to each API user.
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  value:
                    type: string
                    description: tokenID, it acts like sessionID, used in /basket endpoints
                    format: string32
        default:
          $ref: '#/components/responses/error'

components:
  responses:
    error:
      description: an error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  schemas:
    error:
      type: object
      properties:
        error:
          type: string
          description: camelCase styled error code in english
          nullable: true

Configuration without "whitelisted-paths"

return [
    'openapi-file' => __DIR__.'/swagger.yaml',
    'directory' => __DIR__.'/client/no-whitelisted-paths',
    'namespace' => 'API',
];

Configuration with "whitelisted-paths"

return [
    'openapi-file' => __DIR__.'/swagger.yaml',
    'directory' => __DIR__.'/client/whitelisted-paths',
    'namespace' => 'API',
    'whitelisted-paths' => [
        ['/post/data'],
    ]
];

As far as i understand the generate client code should be exactly the same. But with 'whitelisted-paths' defined is missing default response Error model
image
image

@infira infira added the bug label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant