Krishnan79
30 days agoNew Contributor
Solved
Duplicate server variables in OpenAPI
Some one assist on this use case
Facing Duplicate server variables in OpenAPI documentation lead to maintenance issues and violate the DRY principle
Example:
servers:
- name: Server 1
variables:
foo:
$ref: '#/variables/foo'
- name: Server 2
variables:
bar:
$ref: '#/variables/bar'
variables:
foo:
value: 'foo-value'
bar:
value: 'bar-value'
Hi Krishnan79
Try creating a centralized 'variables' section and used the '$ref' keyword to reference variables in each server, eliminating duplication and it improves maintenance as well.