swagger-api / swagger-api/swagger-codegen-generators

HTML clients have Apache 2.0 license URL as default

Open Beginner friendly
#1,298 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

Relates to #140

It looks like the "html" and "html2" client generators use the Apache 2.0 license URL as default if the OpenAPI document does not specify a license:
https://github.com/swagger-api/swagger-codegen-generators/blob/e34685e086e0372a205563768ee80a89ec5cae3d/src/main/java/io/swagger/codegen/v3/generators/html/StaticHtmlCodegen.java#L58
https://github.com/swagger-api/swagger-codegen-generators/blob/e34685e086e0372a205563768ee80a89ec5cae3d/src/main/java/io/swagger/codegen/v3/generators/html/StaticHtml2Codegen.java#L71

This is problematic because it is not clear in the generated HTML documentation what this license applies to, and maybe the developer who publishes the documentation for their API does not want to provide the documentation under that license.

It would be best if this default license URL was omitted, and license information was only shown in case a license is explicitly specified.

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 src/main/java/io/swagger/codegen/v3/generators/html/StaticHtmlCodegen.java at line 58 and StaticHtml2Codegen.java at line 71, then inspect how each generator renders license information. Confirm the generated HTML omits license information when the OpenAPI document has no explicit license, while preserving explicitly supplied license details.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.