Can't load external exemples (relative paths) #916
-
I have examples in my 3.1 OpenAPI specifications like that: components:
examples:
firstExample:
summary: A sample example
externalValue: "./fixtures/output/examples.json#/0" When I import my yaml file, I got an error:
Please note that I'm using "Direct upload artifact" feature and when I try to use "Is a Secondary Artifact ? Just merge examples into existing API | Service definition. " select box, I have a success message but nothing appear in "APIs & Services" section Any idea ? Any process to load these external files ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hello @oliviernguyenquoc, As of today, we do not follow refs provided by components:
examples:
firstExample:
$ref: './fixtures/output/examples.json' may work (not sure we're handling the subsequent path correctly though). This could be a nice enhancement to bring to the OpenAPI importer. |
Beta Was this translation helpful? Give feedback.
Hi @oliviernguyenquoc,
I've done some additional tests, and you're right: this is not supported as of today. Reference resolution is only done for external file fetching during validation but not for example value extraction. I think supporting
externalValue
with JSON Path/Pointer in your initial example is the way to go.It would be awesome if you created a new issue in
microcks/microcks
asking for an enhancement/feature request. A comprehensive sample to illustrate the way you'd like/plan to use this feature is also more than welcome!Thanks,