Swagger 从$ref中将域提取为常量

Swagger 从$ref中将域提取为常量,swagger,openapi,Swagger,Openapi,在swagger/openapi中,您可以定义对另一个文档的URL引用,如下所示: $ref: 'http://example.com/path/to/my/resource' myDomain: 'http://example.com/path/to' ... $ref: '${myDomain}/my/resource 但我不太赞成在yaml中复制多次域。 有没有办法像提取一个常数一样提取URL的一部分?我想这样做: $ref: 'http://example.com/path/to/m

在swagger/openapi中,您可以定义对另一个文档的URL引用,如下所示:

$ref: 'http://example.com/path/to/my/resource'
myDomain: 'http://example.com/path/to'
...
$ref: '${myDomain}/my/resource
但我不太赞成在yaml中复制多次域。 有没有办法像提取一个常数一样提取URL的一部分?我想这样做:

$ref: 'http://example.com/path/to/my/resource'
myDomain: 'http://example.com/path/to'
...
$ref: '${myDomain}/my/resource