Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

[BUG] Unable to use args as schema property because it collides with another method input #69

@spacether

Description

@spacether

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When generating a Python client from specs where a API request body has a field named args defined, the generated model file corresponding to the Request Body object contains the following error: Duplicate parameter "args"

openapi-generator version

6.2.1

OpenAPI declaration file content or url

pythonbug.yaml

openapi: 3.0.2
info:
  title: Bug API
  version: '0.0'
  contact:
    name: Curvegrid
  description: Python Client Bug API.
servers:
  - url: 'http://{hostname}'
    variables:
      hostname:
        default: localhost:8080
        description: Bug Test Server.
tags:
  - name: test
paths:
  /foo:
    post:
      operationId: foo
      summary: FooBaz
      description: FooBar.
      tags:
        - test
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request'
      responses:
        '200':
          description: OK
components:
  schemas:
    Request:
      title: Request
      type: object
      description: A test request body.
      properties:
        args:
          type: string
      required:
        - args
Generation Details
Steps to reproduce

openapi-generator-cli generate -g python -i pythonbug.yaml -o python_client

Related issues/PRs
Suggest a fix

Add args to reserved words

Original bug from: OpenAPITools/openapi-generator#13954

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions