i am having issues with OpenAPI , so here i am asking for help.
My problem is that i am having a .yml file where my routes are imported and it looks like this
as you can see the persons such as assets are in default what i want to do is to give them tags to be separated from each other so it looks like this for example
So what i did is when there is for example a GET method then i give a tag to it like that:
paths:
"/persons/{person_id}/":
get:
tags:
- Person
summary: persons#index":
i defined a global tags variable at the top like this:
tags:
- name: Person
- name: Asset
My problem is that i am having more than 1000 lines of code and i am not able to write these lines of code manually under every piece of get method
Is there a way to kinda make it easier? I am thinking of something like this when you define a tag and you pass everything under that should belong to that tag.
Kinda like this:
tags:
- name: Person
paths:
"/persons/{person_id}/load_autocomplete_parent":
get:
summary: persons#load_autocomplete_parent
"/persons/load_autocomplete":
get:
summary: persons#load_autocomplete
"/persons/load_name":
get:
summary: persons#load_name
"/persons/tree":
thanks
It is not the answer you are looking for, but no, you can't do anything like that.
According to the specification you can use the tags
field in two place:
the OpenAPI Object, the root of your document, where you can have a a list of tags used by the specification with additional metadata, that is, the global tags that you mentioned.
the Operation Object, that describes a single API operation on a path. This is what you are already doing in the single endpoints.