OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Java] [Maven] InputSpec download from url

Open
#2,241 11 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature OpenAPI Generator Maven Plugin
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Currently inputSpec must be a file located in the filesystem.

It would be nice to provide an uri like "file:///..." or "http://..." and the maven plugins decides whether it should download the file first or not.

Usually to wanna generate sources for a public service providing a swagger.json file somewhere.

Changes could happen here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L383

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 in modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java around the inputSpec handling near line 383. Trace how the Maven plugin currently reads the specification, then determine how local paths and file:// or http:// URIs should be handled. Done means a public remote specification can be used for source generation without breaking filesystem paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.