Closed StarfallProjects closed 2 years ago
Thank You for reporting this issue.
Could you please share some details about your specification file? I am asking because that portion of code is trying to read the tags
of an Operation
object (reference), which should not be a string.
More information would help me understanding the circumstances for this error to happen.
Sure! The draft PR is here: https://github.com/n8n-io/n8n-docs/pull/818 Thanks for looking at it!
Thank You @StarfallProjects, now I understand the case!
It's about a feature that is currently missing in essentials-openapi
, that is support for OpenAPI Specification files split among multiple files (ref.).
I'm willing to add this feature, it shouldn't be much work. PS. I am slow when replying during the day because I cannot reply here while at work.
I started working on this new feature, but I need a bit more time to complete it, in the worst case I should be able to publish it in the weekend.
Ah amazing! Looking forward to seeing it :-)
Hi! I share a preview of the work in progress:
However, I noticed more improvements that can be done to better satisfy your use case.
The most complex detail is this one: you are using $ref to external files when describing properties like this (e.g. in WorkflowInformation.yml
):
nodes:
type: array
items:
$ref: './NodeInformation.yml'
For such cases, it would be best if the tool that generates markdown code from OAD files was able to configure automatically entries to the components
section (or reuse existing $refs), so that NodeInformation
can be described once and linked (meaning configured automatically as '#/components/schemas/NodeInformation').
The alternative would require an action on your side, meaning for example, to edit your file WorkflowInformation.yml
to replace $ref: './NodeInformation.yml'
with $ref: '#/components/schemas/NodeInformation'
. This would make sense anyway since you are also specifying the NodeInformation entity $ref: './NodeInformation.yml'
inside ./schemas/_index.yml
.
By the way, this is very interesting for me because it's the first time I interact with a technical writer about OpenAPI Documentation - I always spoke about these with programmers who want their documentation to be generated automatically by some tool (I often had a different point of view compared to my colleagues, because I see the value of hand-written technical documentation).
I'll take care of those details, anyway, it doesn't take much time - so you don't need to change your references.
[UPDATE] after looking into the topic, there are too many complications handling automatic replacements of $ref
links going always to files instead of #/components/schemas/…
.
I will release a new version of mkdocs-plugins
and essentials-openapi
to add support for resolving file references, but it won't include that additional optimization.
In other words, the proper way should be to use $ref
links as you are doing in ./schemas/_index.yml
, but then not reference the same files in Object and Array schemas - instead reference #/components/schemas/…
for those.
Hi @StarfallProjects I just published two updates.
Can you please try again after upgrading these dependencies:
pip install -U neoteroi-mkdocs essentials-openapi
Please also read my previous messages, to reuse the schema definitions from your components
section instead of linking the files.
@RobertoPrevato picking up these messages this morning - thanks so much for the detailed guidance. I'll feed back to our devs about the $ref format.
Have set up neoteroi.mkdocsoad, but when running
mkdocs serve
, am getting: