OpenAPITools / OpenAPITools/openapi-generator

openapi schema 3.0 yaml warnings and inline_response_ files are not generating in go server stub code

Open
#2,030 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

  1. i created my yaml with openapi 3.0 specification

  2. generated the go server stub code and getting below warnings.

  3. WARN - o.o.codegen.utils.ModelUtils - Multiple schemas found, returning only the first one

  4. WARN o.o.codegen.DefaultCodegen - The following schema has undefined (null) baseType. It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. A correct 'consumes' for form parameters should be 'application/x-www-form-urlencoded' or 'multipart/form-data'
    [main] WARN o.o.codegen.DefaultCodegen - schema: class ComposedSchema {
    class Schema {
    title: null
    multipleOf: null
    maximum: null
    exclusiveMaximum: null
    minimum: null
    exclusiveMinimum: null
    maxLength: null
    minLength: null
    pattern: null
    maxItems: null
    minItems: null
    uniqueItems: null
    maxProperties: null
    minProperties: null
    required: null
    type: null
    not: null
    properties: null
    additionalProperties: null
    description: null
    format: null
    $ref: null
    nullable: null
    readOnly: null
    writeOnly: null
    example: null
    externalDocs: null
    deprecated: null
    discriminator: null
    xml: null
    }
    allOf: null
    anyOf: null
    oneOf: [class Schema {
    title: null
    multipleOf: null
    maximum: null
    exclusiveMaximum: null
    minimum: null
    exclusiveMinimum: null
    maxLength: null
    minLength: null
    pattern: null
    maxItems: null
    minItems: null
    uniqueItems: null
    maxProperties: null
    minProperties: null
    required: null
    type: null
    not: null
    properties: null
    additionalProperties: null
    description: null
    format: null
    $ref: #/components/schemas/AppTerminationNotificationSubscription
    nullable: null
    readOnly: null
    writeOnly: null
    example: null
    externalDocs: null
    deprecated: null
    discriminator: null
    xml: null
    }, class Schema {
    title: null
    multipleOf: null
    maximum: null
    exclusiveMaximum: null
    minimum: null
    exclusiveMinimum: null
    maxLength: null
    minLength: null
    pattern: null
    maxItems: null
    minItems: null
    uniqueItems: null
    maxProperties: null
    minProperties: null
    required: null
    type: null
    not: null
    properties: null
    additionalProperties: null
    description: null
    format: null
    $ref: #/components/schemas/SerAvailabilityNotificationSubscription
    nullable: null
    readOnly: null
    writeOnly: null
    example: null
    externalDocs: null
    deprecated: null
    discriminator: null
    xml: null
    }]
    }

  5. WARN o.o.codegen.DefaultCodegen - codegenModel is null. Default to UNKNOWN_BASE_TYPE

One more Observation like model_inline_response_*.go files are not generating which are generated in 2.0.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing Go server stub generation with the reported OpenAPI 3.0 YAML and compare it with the 2.0 output. Investigate the listed warnings and the missing model_inline_response_*.go files; done means the relevant warnings are resolved and the expected inline response files are generated.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, openapi
Domain
backend-api-design, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.