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

[typescript-axios] query property renamed to _query #12387

Open
robertkowalski opened this issue Apr 29, 2024 · 0 comments
Open

[typescript-axios] query property renamed to _query #12387

robertkowalski opened this issue Apr 29, 2024 · 0 comments

Comments

@robertkowalski
Copy link

Description

We use swagger-codegen and have a property query, but in the Typescript export it is renamed to _query. With previous versions it worked.

Swagger-codegen version

3.0.55, seems to be a regression

Swagger declaration file content or url
openapi: 3.0.0
info:
  title: Test Schema Bugreport
  version: 1.19.1

paths:
  /api/test:
    post:
      summary: Send a event
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: 'array'
              items:
                oneOf:
                  - $ref: '#/components/schemas/BasicEvent'
      responses:
        '200':
          description: The request was successful
components:
  schemas:
    BasicEvent:
      type: object
      required:
      description: |
        A basic description of an event.
      properties:
        query:
          title: Query
          type: string
          format: ^([^=&]+=[^=&]*)(&([^=&]+=[^=&]*)?)*$
          description: A query-formatted and url encoded string to provide attributes. Multiple values for one parameter should be separated with a encoded comma (e.g. "a%2Cb" for the values a and b).
          example: '?foo=bar&xyz=12%263&csv=a%2Cb'
Command line used for generation
swagger-codegen generate -i schema.yaml -l typescript-axios -o out
Steps to reproduce
  1. Run swagger-codegen
  2. inspect result, _query? should be query?:
/* tslint:disable */
/* eslint-disable */
/**
 * Test Schema Bugreport
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 1.19.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

 /**
 * A basic description of an event. 
 *
 * @export
 * @interface BasicEvent
 */
export interface BasicEvent {

    /**
     * A query-formatted and url encoded string to provide attributes. Multiple values for one parameter should be separated with a encoded comma (e.g. \"a%2Cb\" for the values a and b).
     *
     * @type {string}
     * @memberof BasicEvent
     * @example ?foo=bar&xyz=12%263&csv=a%2Cb
     */
    _query?: string;
}
Related issues/PRs
Suggest a fix/enhancement
@robertkowalski robertkowalski changed the title [TS] query property renamed to _query [typescript-axios] query property renamed to _query Apr 30, 2024
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