Skip to content
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

[Core, HTML2] Rendered docs are incomplete #3496

Closed
wants to merge 1 commit into from
Closed

[Core, HTML2] Rendered docs are incomplete #3496

wants to merge 1 commit into from

Conversation

richardwhiuk
Copy link
Contributor

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    • No technical committee for HTML 2.

Description of the PR

  • Simple aliased types are now passed to the generator

  • Body parameters are now provided with their schemas

  • Schema block is now visible in the generated documentation

Note, this changes some of the core behaviour, which doesn't pass aliased models to the generator, so may have large scale impacts.

Changes are by @MalachiJones, @mthebridge, @richardwhiuk and others at @Metaswitch

This fixes #1441

- Simple aliased types are now passed to the generator

- Body parameters are now provided with their schemas

- Schema block is now visibile in the generated documentation
@richardwhiuk richardwhiuk added the Doc: HTML Generation of HTML documentation label Jul 29, 2019
@@ -4,7 +4,11 @@
<script>
$(document).ready(function() {
var schemaWrapper = {{{jsonSchema}}};
var schema = schemaWrapper.schema;

var schema = findNode('schema',schemaWrapper).schema;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will find node alway return a result here?

continue; // Don't create user-defined classes for aliases
}
}
// if (modelTemplate != null && modelTemplate.containsKey("model")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain what is the impact of this change?

@macjohnny
Copy link
Member

@richardwhiuk thanks for your PR!

@eclipse1985
Copy link

Is this related to #2427 ?

@frank-schoenheit-red6es
Copy link

anybody here who can bring this forward? Recently migrated to openapi-generator from swagger-generator, and using the html generator as an opportunity to publish a "have a quick look" version of the API documentation during a Jenkins build. The bug here breaks this approach :-(

@macjohnny
Copy link
Member

@richardwhiuk can you resolve the conflicts?

@richardwhiuk
Copy link
Contributor Author

@macjohnny Yeah, I'll resolve the conflicts.

We've spotted some bugs that occur with this fix that I think should be covered along with this fix - I'll try and get those resolved this week.

@frank-schoenheit-red6es
Copy link

thanks for your efforts, guys!

@eclipse1985
Copy link

@richardwhiuk any update :)?

@Fjolnir-Dvorak
Copy link
Contributor

Fjolnir-Dvorak commented Feb 13, 2020

Thank you for the merge request. I tried it a few minutes ago and merged it with the latest master. Simple objects are working but if objects are nested it still does not work. Concerning the merge conflict I accepted the master and tried also to comment the defaultGenerator passage out as the pull request did.
I hope I will remember to design a simple test yaml to visualize the error which I will post here

The problem I found so far occurs if the response is a list of objects.

paths:
  /url:
    post:
      responses:
        200:
          description: successful operation
          content:
            application/json:
              schema:
                type:
                  array
                items:
                  $ref: '#/components/schemas/AdvData'

@rachanadeshmukh
Copy link

Hi, are there any updates on the status of merging this fix? My team is currently dependent on this in order to generate static html2 documentation based on openapi specs that contain all the required annotated documentation (including request schemas). We are using the gradle plugin for this.

@JonarJr
Copy link

JonarJr commented Feb 28, 2020

any updates for this fix?

@masci
Copy link
Contributor

masci commented Mar 23, 2020

Patch in #5643 works for me

@jimschubert
Copy link
Member

I've merged master into this code and opened/merged #7510

As mentioned earlier, #5643 was opened with a similar fix, but after checking the code between the two branches it looks like that PR just copied this code and refactored. I'm pretty big on attribution of contributions, so I've replaced the findNode changes from #5643 with the findNode implementation from this PR.

@jimschubert jimschubert added this to the 5.0.0 milestone Sep 26, 2020
@richardwhiuk richardwhiuk deleted the html2-docs-incomplete branch June 2, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Doc: HTML Generation of HTML documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[html2] missing body/response schema documentation
10 participants