Support `"in": "body"` parameter
This is a bug report related to the generation of a node from a Swagger definition.
Description
I have the following Swagger definition 2.0 that I want to generate the node using nodebuilder by executing the following command : npm run generate
I generated successfully the node with this command,
However, I got the following error while I add the generated files in the following directory \packages\nodes-base\nodes{myDirectory} of the project n8n (see the following image) :
!
Could you please review the tool nodebuilder, so that it can fix the generated error Swagger_def.txt ?
Thank you in advance for your help
Thank you for your report. The fixes will be merged soon - meanwhile here is the correct output.
Note that nodebuilder builds most of the node, but not yet all of it - it does not create the credentials file and the icon. You will also need to fill in the placeholders USERTASK in openApiRequestAllItems in GenericFunctions.ts.
Thank you for your quick reply. I will check and keep you informed
I have just checked the generated file. The generation process terminated well. And I can add the generated file as a custom node in the n8n project.
But, there is still a problem... When you look into the Swagger definition, you will have a "schema" block that has been predefined for query parameter and for response as follows

However, I cannot find the code generated for schema of query parameter and schema of response.
Does your generation tool take into account these pieces of information during its generation process ?
@ivov Do you have any idea about my question ?
Dereferencing is supported. This works correctly for the sample Lichess spec and also for OpenCell. You can inspect the dereferenced spec at ./src/input/_deref.json after generation.
https://github.com/ivov/nodebuilder/blob/06f9d1a351429125153da8d22c35e4150146a919/src/services/OpenApiStager.ts#L36-L45
What is not supported is the "in": "body" parameter, as it had not come up in my own use cases. Will keep this issue open and support this in future, hopefully soon, as time allows.
https://github.com/ivov/nodebuilder/blob/06f9d1a351429125153da8d22c35e4150146a919/src/types/params.d.ts#L72-L80
Hello @ivov , thank you very much for your reply.
I hope you can soon support "in": "body" parameter
Hello @ivov ,
I found the file _deref.json that has been generated by processing dereferencing. However, I do not know where to add this dereferenring file in n8n project so that n8n can take into consideration this file. Any idea ?
Nodebuilder dereferences the spec (i.e. replaces its references at $ref with the actual params) into _deref.json and then parses that file into an n8n node. Therefore, _deref.json is an only intermediate output, not meant for the user. I mentioned it above to make clear that dereferencing is taken care of.
What remains to be done is enabling the parser to generate params for "in": "body", as it does for "path", "query" and "header".
Hi @ivov : Do you have good news about the implementation of the parser for parameter "in": "body"