Merge several definitions #635
-
How I can using separate file and merge in the one file for overwrites field ? overwrites:
- $ref: './tests/portman/definitions/overwrites-vehicle.yml#/overwrites'
- $ref: './tests/portman/definitions/overwrites-vehicle-v2.yml#/overwrites' in the case I got error Invalid Portman Config: ./tests/portman/portman-config.crm.yml
[
{
message: "'0' property type must be object",
path: '{base}.overwrites.0',
context: { errorType: 'type' }
},
{
message: "'1' property type must be object",
path: '{base}.overwrites.1',
context: { errorType: 'type' }
}
] I need split this entity on the two file or more, and after combine to one in the overwrite or tests:
contentTests:
- $ref : ...
- $ref : ... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
hi @vampyar We created a small example using $references: https://github.com/apideck-libraries/portman/tree/main/examples/config-references, which could be helpful. |
Beta Was this translation helpful? Give feedback.
-
hi @thim81 Yep I got it but your example you include one
like example:
|
Beta Was this translation helpful? Give feedback.
-
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.
With the portman-variation-tests.json containing objects:
|
Beta Was this translation helpful? Give feedback.
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.
With the portman-variation-tests.json containing objects: