ivov / nodebuilder

Build n8n nodes from OpenAPI specs and YAML files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] OpenAPI generator produces invalid output

mayrmax opened this issue · comments

First of all really cool idea for a project, I tried it out with an OpenAPI spec that contains a lot of descriptions. If one of them has an ' inside e.g. to indicate possible strings like 'asc' or 'desc' the output produces an invalid file.

Example:
{ "name": "OrderBy", "in": "query", "description": "Sort order of the returned 'Values' (default: \"asc\", alternative: \"desc\")\r\nValues are ordered by Timestamp", "schema": { "type": "string", "description": "Sort order of the returned 'Values' (default: \"asc\", alternative: \"desc\")\r\nValues are ordered by Timestamp" } },

Thank you for the report.

I tested this by replacing one of the descriptions in the sample Lichess spec with "Sort order of the returned 'Values' (default: \"asc\", alternative: \"desc\")\r\nValues are ordered by Timestamp" and generation worked, so I could not reproduce.

Can you share a link to your spec?

Unfortunately its an internal api, but the generation itself was not the problem. The problem is that due to the output using ' for strings it breaks when the string includes an '. So the result would be: 'This is an 'example' for the problem'.

This should now be fixed. Feel free to reopen if the issue persists.