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] [python] [python-pydantic-v1] generator template malformats markdown in description sections #20464

Open
4 of 6 tasks
jmartens opened this issue Jan 14, 2025 · 4 comments

Comments

@jmartens
Copy link

jmartens commented Jan 14, 2025

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

When generating documentation for the Topdesk incident API the parameter sections of the documentation is mangled up, output for incidents_id_id_archive_put is like this:

| Permission | Remark | |---------|-----------| | Operator | With 1st line incident write permission and write permission for archiving incidents; Category/Branch/Operator filters apply | | Person | No access | **NOTE**: * _PATCH_ operation can be used as well * If the incident has partial incidents they will also archived.

where it should be:

| Permission | Remark |
|---------|-----------|
| Operator | With 1st line incident write permission and write permission for unarchiving incidents; Category/Branch/Operator filters apply |
| Person | No access |
**NOTE**:
* _PATCH_ operation can be used as well

to render properly.

openapi-generator version

7.10.0

OpenAPI declaration file content or url

https://developers.topdesk.com/swagger/incident_specification_3.8.5.yaml

Generation Details

openapi-generator-cli generate -i https://developers.topdesk.com/swagger/incident_specification_3.8.5.yaml -g python

Steps to reproduce

openapi-generator-cli generate -i https://developers.topdesk.com/swagger/incident_specification_3.8.5.yaml -g python

Related issues/PRs
Suggest a fix

I think the templates miss a newline

@jmartens jmartens changed the title [BUG] Description [BUG] python generator template malformats parameter sections Jan 14, 2025
@jmartens
Copy link
Author

jmartens commented Jan 14, 2025

Tested with latest snapshot jar (openapi-generator-cli-7.11.0-20250114.142750-100.jar) to confirm that issue is still present.

@jmartens
Copy link
Author

  • Have you validated the input using an OpenAPI validator (example)?

No see #20465

@jmartens jmartens changed the title [BUG] python generator template malformats parameter sections [BUG] [Python] generator template malformats parameter sections Jan 14, 2025
@jmartens
Copy link
Author

Tested with latest snapshot jar (openapi-generator-cli-7.11.0-20250114.142750-100.jar) to confirm that issue is still present.

python-pydantic-v1 also seems to suffer the same, also against above jar.

@jmartens jmartens changed the title [BUG] [Python] generator template malformats parameter sections [BUG] [python] [python-pydantic-v1] generator template malformats parameter sections Jan 14, 2025
@jmartens jmartens changed the title [BUG] [python] [python-pydantic-v1] generator template malformats parameter sections [BUG] [python] [python-pydantic-v1] generator template malformats permission sections Jan 14, 2025
@jmartens
Copy link
Author

where it should be:

| Permission | Remark |
|---------|-----------|
| Operator | With 1st line incident write permission and write permission for unarchiving incidents; Category/Branch/Operator filters apply |
| Person | No access |
**NOTE**:
* _PATCH_ operation can be used as well

to render properly.

The original contents from the yaml source file (line 3568-3574) has newlines:

      description: |
        | Permission | Remark |
        |---------|-----------|
        | Operator | With 1st line incident write permission and write permission for unarchiving incidents; Category/Branch/Operator filters apply |
        | Person | No access |
        **NOTE**:
        * _PATCH_ operation can be used as well

@jmartens jmartens changed the title [BUG] [python] [python-pydantic-v1] generator template malformats permission sections [BUG] [python] [python-pydantic-v1] generator template malformats description sections Jan 14, 2025
@jmartens jmartens changed the title [BUG] [python] [python-pydantic-v1] generator template malformats description sections [BUG] [python] [python-pydantic-v1] generator template malformats markdown in description sections Jan 14, 2025
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

1 participant