cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple versions with different parameters from the same yaml file

Highlighted
Regular Visitor

Multiple versions with different parameters from the same yaml file

Hi,

 

I have an API documentation, which looks like this:

 

paths:
  <api-path>:
    post:
      parameters:
        - $ref'#/parameters/<parameter_1>'
        - $ref: '#/parameters/<parameter_2>'
        - $ref: '#/parameters/<parameter_3>'
        - ...
 
The API is used by internal and external sources. We want to hide some parameters from the external sources. So in this example, what I want is to create 2 different HTML page from the same source code (yaml file):
  1. "internal" HTML, which contains every parameter for the API endpoint
  2. "external" HTML, which contains only some of the parameters for the API endpoit (in this case, it would only contain parameter_1 and parameter_3, but not parameter_2).

How can I do this without copy-pasting the same YAML code over and over again?

 

Thanks in advance!

New Here?
Join us and watch the welcome video:
Top Kudoed Authors
Top Kudoed Posts