vacuum icon indicating copy to clipboard operation
vacuum copied to clipboard

Vacuum failing for component names that contain special characters

Open ndimares opened this issue 1 year ago • 4 comments

The attached spec uses the following convention for its component names:

#/components/parameters/async_search.submit#wait_for_completion_timeout

that causes Vacuum to error with:

component '#/components/parameters/async_search.submit#wait_for_completion_timeout' does not exist in the specification

However the component in question does exist:

"async_search.submit#wait_for_completion_timeout": {
        "in": "query",
        "name": "wait_for_completion_timeout",
        "description": "Blocks and waits until the search is completed up to a certain timeout.\nWhen the async search completes within the timeout, the response won't include the ID as the results are not stored in the cluster.",
        "deprecated": false,
        "schema": {
          "$ref": "#/components/schemas/_types:Duration"
        },
        "style": "form"
      }, 

I think this is because the component name includes special characters.

Spec in question: openapi.json

ndimares avatar Apr 16 '24 15:04 ndimares

@jamietanna FYI

ndimares avatar Apr 16 '24 15:04 ndimares

The problem is with libopenapi and the fragment, it's splitting off the fragment because of the second hash. libopenapi currently assumes that in any reference. There will be a single hash that denotes the root of the document, anything before it is the URI of the resource, and everything after is the path.

TLDR; The second hash denoting the fragment is the problem because the hash char is used as a delimiter.

daveshanley avatar Apr 17 '24 11:04 daveshanley

Thanks for the explanation. Let me know if you want me to move this over to the libopenapi board. It's not an urgent issue as I don't think the Elastic team has any immediate use cases. Although hopefully they'll adopt some of the tooling down the road!

ndimares avatar Apr 17 '24 16:04 ndimares

yeah, if you could move this issue over there it would be helpful as I can't fix the problem in vacuum.

daveshanley avatar Apr 18 '24 21:04 daveshanley