OpenAPITools / OpenAPITools/openapi-generator

[BUG][SPRING] execution with configuration file does not apply

Open
#18,937 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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

The main problem that occurs to me is that the generation command does not use the properties that it applied with a yml file, it is assumed that all the properties are those that are documented for Spring and there is no way for them to be applied.

openapi-generator version
services:
  openapi-generator-version:
    image: openapitools/openapi-generator-cli
    command: version

openapi-generator-version-1 | 7.7.0-SNAPSHOT
openapi-generator-version-1 exited with code 0

OpenAPI declaration file content or url

I am using the example file petstore.yaml for the open api definition, since my current intention is to configure the tool to generate the client and the server as I am interested.

petstore.yaml

Generation Details

I have prepared the following configuration file but not all the characteristics indicated in the documentation apply to me.

Spring-doc

I have put some characteristics of one of the examples to see if it reads my file and see how it applies the changes

example see

Then I see that the entire lombok theme applies them but does not apply all the Spring options, such as those of scm or those of develop.

Steps to reproduce

execute command docker.

docker-compose.yml

services:
  openapi-generator-api-v2:
    image: openapitools/openapi-generator-cli
    volumes:
      - ./config\api-config.yaml:/local/api-config.yaml
      - ./data/out:/local/out
      - ./data/petstore.yaml:/local/petstore.yaml
    command: generate -i /local/petstore.yaml -o /local/out/api -c /local/api-config.yaml 

petstore.yaml
api-config.txt

Related issues/PRs
Suggest a fix

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 with docker-compose.yml, api-config.yaml, and the Spring generator configuration example spring-boot-lombok-data.yaml. Run the shown Docker generate command using petstore.yaml, then compare the generated output with the configured Spring options, especially the scm and develop settings. Done means the specified configuration properties are applied during generation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.