-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
fix: typescript docs not being put in a docs directory #22124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: typescript docs not being put in a docs directory #22124
Conversation
I like it. @macjohnny do you think we can make this the default new behavior? Technically it breaks backwards compat. It also doesn't currently check if the path exists before writing into it. |
we can consider this as a bug fix so that it can be included in the upcoming release. if users prefer the old location, they can always move the markdown files post code generation. |
public String apiDocFileFolder() { | ||
return (outputFolder + File.separator + apiDocPath); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
@Override
public String apiDocFileFolder() {
return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ agree with this as it means the apiDocPath
becomes system-agnostic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, pushed a commit to do this.
apiPackage = this.apiPackage + ".apis"; | ||
testPackage = this.testPackage + ".tests"; | ||
|
||
additionalProperties.put("apiDocPath", apiDocPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this even needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not at the moment but when the README
will be updated to be consistent with the other generators and include the docs, it is used there, see the Java README
for example:
openapi-generator/modules/openapi-generator/src/main/resources/Java/README.mustache
Line 194 in cf2435f
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} |
@robertmarsal thanks for the clarification. can you please update the samples? |
When generating code using the
typescript
generator the docs would be placed in the root directory. This fix make the generator consistent with the other generators and puts the docs under a/docs
directorySolves #18276
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)"fixes #123"
present in the PR description)@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) @davidgamero (2022/03) @mkusaka (2022/04) @joscha (2024/10)
After the changes the docs get put in the expected directory:
