Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #12559
Closed
Open
Issue created Jun 08, 2022 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] [PYTHON] Generated class methods without self parameter

Created by: gcatanese

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 the Python client code the class methods do not have self parameter

openapi-generator version

Occurring with v6.0.1-SNAPSHOT

OpenAPI declaration file content or url
openapi: 3.0.3
info:
  description: API with post endpoint
  termsOfService: n/a
  title: API spec
  version: "12"
servers:
- url: http://localhost:8080
tags:
- name: Modifications
paths:
  /postEndpoint:
    get:
      operationId: postEndpoint
      parameters:
      - explode: true
        in: query
        name: options
        required: false
        schema:
          $ref: '#/components/schemas/Options'
        style: deepObject
      responses:
        "200":
          content:
            text/plain:
              schema:
                type: string
          description: OK
components:
  schemas:
    Options:
      properties:
        a:
          format: date-time
          nullable: true
          type: string
        b:
          format: date-time
          nullable: true
          type: string
        c:
          items:
            type: string
          type: array
      type: object
Generation Details

Generated with

java -jar openapi-generator-cli/target/openapi-generator-cli.jar generate \
   -i openapi.yaml \
   -g python \
    -p packageName=checkout \
    -o src
Steps to reproduce

Run the command above

Related issues/PRs

See #12560

Suggest a fix
Assignee
Assign to
Time tracking