Skip to content

Merge several definitions #635

Answered by miriamgreis
vampyar asked this question in Q&A
Discussion options

You must be logged in to vote

hi @vampyar, it depends on how your file with the refs is structured.

It should work in your very first example if #/overwrites is an object and not an array. So you cannot include multiple $refs containing arrays, but with objects on a lower level it will work.

With a json config, it works for me like this by just including the $ref on the object level.

{
  "variationTests": [
    {
       ...
    },
    {
       "$ref": "portman-variation-tests.json#/variationTestsUnauthorized"
    }
  ]
}

With the portman-variation-tests.json containing objects:

{
  "variationTestsUnauthorized": {
       "openApiOperation": "*::/*",
       "openApiResponse": "401",
       "variations": [...]
    }
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by thim81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #619 on August 19, 2024 08:10.