openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

Add API/Model Docs to typescript-fetch codegen

Open mason-at-pieces opened this issue 1 year ago • 12 comments

Added support for generating api/model docs for typescript-fetch generator.

Related issue: https://github.com/OpenAPITools/openapi-generator/issues/18276

Related Technical Committee Members: @mkusaka

PR checklist

  • [X] Read the contribution guidelines.
  • [X] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • [X] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH) 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.
  • [X] File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • [X] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

mason-at-pieces avatar Apr 10 '24 20:04 mason-at-pieces

thanks for the PR

cc @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)

wing328 avatar Apr 11 '24 02:04 wing328

can you please follow step 3 to update the samples to address https://github.com/OpenAPITools/openapi-generator/actions/runs/8640982079/job/23690384008?pr=18351 ?

wing328 avatar Apr 11 '24 03:04 wing328

can you please follow step 3 to update the samples to address https://github.com/OpenAPITools/openapi-generator/actions/runs/8640982079/job/23690384008?pr=18351 ?

Yep, forgot to do it again after the fix.

mason-at-pieces avatar Apr 11 '24 03:04 mason-at-pieces

@wing328 Quick question, do you know how to ensure that the docs are generated inside a docs folder instead of just inside the root of the generated sdk?

mason-at-pieces avatar Apr 12 '24 13:04 mason-at-pieces

good question. you will need to override 2 functions to set the folders, e.g. https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CrystalClientCodegen.java#L330-L338

wing328 avatar Apr 12 '24 17:04 wing328

good question. you will need to override 2 functions to set the folders, e.g.

Perfect, just added that

mason-at-pieces avatar Apr 12 '24 17:04 mason-at-pieces

@wing328 Make some updates, should be good to rip another build?

mason-at-pieces avatar Apr 18 '24 18:04 mason-at-pieces

the tests still failed. please take another look when you've time

wing328 avatar Apr 19 '24 12:04 wing328

@mason-at-pieces please rebase onto the lastest master branch and re-generate the samples.

macjohnny avatar Apr 22 '24 07:04 macjohnny

with this change, did you run a simple test to generate a petstore ts fetch client? did it fail?

wing328 avatar Apr 24 '24 07:04 wing328

looks like a rebase/merge failed and resulted in lots of commits not authored by you included in this PR

i would suggest you file a new one instead.

wing328 avatar May 01 '24 13:05 wing328

looks like a rebase/merge failed and resulted in lots of commits not authored by you included in this PR

i would suggest you file a new one instead.

Yeah, I will just create another branch on my fork and make a new pr from that 👍

mason-at-pieces avatar May 01 '24 13:05 mason-at-pieces