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

[BUG] [HTML2] Syntax Error in HTML-File: ", or ) expected" #12842

Closed
5 of 6 tasks
kas1337 opened this issue Jul 12, 2022 · 2 comments
Closed
5 of 6 tasks

[BUG] [HTML2] Syntax Error in HTML-File: ", or ) expected" #12842

kas1337 opened this issue Jul 12, 2022 · 2 comments

Comments

@kas1337
Copy link

kas1337 commented Jul 12, 2022

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The html2-Generator generates a HTML-File with syntax error. Hence, the responses in the schema cannot be displayed.

openapi-generator version

v6.0.1

v6.0.0 works fine

OpenAPI declaration file content or url

The entire json file and the resulting index.html file can be found here: https://gist.github.com/kas1337/c1f1a74ccbe485fffb168fd482e8089d

Generation Details & Steps to reproduce

I've tested with the latest master branch as described here https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator using the following command (Linux)

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g html2 -i openapi.json
Actual output

See the lines from 1297. The are paranthesis missing to close the forEach-Loop. This error can be found multiple times.

Object.keys(schema.properties).forEach( (item) => {
  if (schema.properties[item].$ref != null) {
    schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
  }
Expected output
Object.keys(schema.properties).forEach( (item) => {
  if (schema.properties[item].$ref != null) {
    schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
  }
});
Related issues/PRs
Suggest a fix

Thank you!

@kas1337
Copy link
Author

kas1337 commented Jul 26, 2022

@wing328 Hey 👋 I tried to push a branch with the suggested fix so that I can open a PR. However, I get a 403-Error when trying to push the branch to the repository. Do I need some sort of access if I want to push to the repo? The error is

$ git push -u origin fix_issue12842
remote: Permission to openapitools/openapi-generator.git denied to kas1337.
fatal: unable to access 'https://github.com/openapitools/openapi-generator.git/': The requested URL returned error: 403

The authentication seems to work right.

@kaihenkel
Copy link

#13272 addresses the same issue and was fixed recently

@wing328 wing328 closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants