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
  • #2706
Closed
Open
Issue created Apr 20, 2019 by Administrator@rootContributor4 of 5 checklist items completed4/5 checklist items

System properties do not make it down to dependencies

Created by: jdomizio

Bug Report Checklist

  • [n/a] Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Option to set system property -Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true in openapi-generator-cli does not actually set a system property that can be read by System.getProperty() call in io.swagger.v3.parser.util.RemoteUrl

openapi-generator version

v4.0.0-beta3

OpenAPI declaration file content or url

n/a

Command line used for generation
docker run --rm -v ${PWD}:/local \
    openapitools/openapi-generator-cli:v4.0.0-beta3 generate \
    -Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true \
    -i https://xxx.dev.yyy.local/api/v1/swagger.json \
    -g csharp-netcore \
    -o /local/xxx

Unfortunately the url I am testing against is on a closed network, and I don't have an example that is internet-accessible.

The actual output I am seeing is here (https://gist.github.com/jdomizio/a21471b8a1b65b8b5904aad2e9276b44)

the expected output is the normal output for code generation.

Steps to reproduce

Run the above command against a swagger document hosted under https with a self-signed certificate. After pulling the v4.0.0-beta3 tag and modifying org.openapitools.codegen.config.CodegenConfigurator.setSystemProperties

to

    private void setSystemProperties() {
        for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
            System.setProperty(entry.getKey(), entry.getValue());
            GeneratorProperties.setProperty(entry.getKey(), entry.getValue());
        }
    }

the expected system property gets set and I can successfully run the cli tool against self-signed endpoints again.

Related issues/PRs

(https://github.com/OpenAPITools/openapi-generator/issues/845#issuecomment-415316114)

Suggest a fix

Looks like previously a decision was made to remove use of System.(set|get|clear)Property. A dependency of openapi-generator: swagger-parser still depends on properties being set such that System.getProperty() can retrieve them. Is there a plan to update or replace those dependencies such that they rely on the same mechanisms with the v4.0.0 release?

(https://github.com/OpenAPITools/openapi-generator/commit/98ae7a816c0af87202fe7cc61a8605f448533f6a#diff-9981d70179c9125460299c24c3efa319)

Assignee
Assign to
Time tracking