A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/OpenAPITools/openapi-generator/issues/455 below:

[codegen] external $ref in parameters not supported · Issue #455 · OpenAPITools/openapi-generator · GitHub

Description

When a parameter schema $ref references an external yaml file, code generation fails.

openapi-generator version

openapi-generator-cli-3.0.3.jar

OpenAPI declaration file content or url

here is a yaml definition fragment relating to the code generation failure:

  /nf-instances/{nfInstanceID}:
    get:
      summary: Read the profile of a given NF Instance
      operationId: GetNFInstance
      tags:
        - NF Instance ID (Document)
      parameters:
        - name: nfInstanceID
          in: path
          description: Unique ID of the NF Instance
          required: true
          schema:
            $ref: './TS29571_CommonData.yaml#/components/schemas/NfInstanceId'
      responses:
        '200':
          description: Expected response to a valid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NFProfile'
Command line used for generation

java -jar ./openapi-generator-cli-3.0.3.jar generate -i TS29510_Nnrf_NFManagement.yaml -g jaxrs-resteasy -o samples.openapi

Steps to reproduce

Output is as follows when code generation fails:

 java  -jar ./openapi-generator-cli-3.0.3.jar generate -i TS29510_Nnrf_NFManagement.yaml -g jaxrs-resteasy -o samples.openapi 
[main] WARN  o.o.c.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' not defined in the spec (2.0). Default to http://localhost
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' not defined in the spec (2.0). Default to http://localhost
[main] WARN  o.o.codegen.utils.URLPathUtils - 'host' not defined in the spec (2.0). Default to http://localhost
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: ./TS29571_CommonData.yaml#/components/schemas/NfInstanceId
[main] WARN  o.o.codegen.utils.ModelUtils - Failed to get the schema name: ./TS29571_CommonData.yaml#/components/schemas/NfInstanceId
[main] INFO  o.o.codegen.AbstractGenerator - writing file .....\samples.openapi\src\gen\java\org\openapitools\model\AmfInfo.java
[main] INFO  o.o.codegen.AbstractGenerator - writing file .....\samples.openapi\src\gen\java\org\openapitools\model\AusfInfo.java
[main] INFO  o.o.codegen.AbstractGenerator - writing file .....\samples.openapi\src\gen\java\org\openapitools\model\BsfInfo.java
[main] INFO  o.o.codegen.AbstractGenerator - writing file .....\samples.openapi\src\gen\java\org\openapitools\model\DataSetId.java
[main] INFO  o.o.codegen.AbstractGenerator - writing file .....\samples.openapi\src\gen\java\org\openapitools\model\DefaultNotificationSubscription.java

Related issues/PRs

#149

Suggest a fix/enhancement

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4