openapi: 3.0.2
info:
  version: '1.0'
  title: Provide your own API Key
  description: |
    There are cases where you would like to specify a pre generated API key. 
    
    You can do that with RapiDoc. This can be done decleratively by providing `api-key` details as attributes on the web-components or programatically using JavaScript, 

    For this to get working you **MUST** specify the following attributes with default values

    - `api-key-location`
    - `api-key-name`
    - `api-key-value` (default it to hyphen(-) if you want to provide it later using JavaScript)

    ```html
      <html>
        ...
        <body>
          <rapi-doc
            spec-url='spec.yml'
            api-key-name = "api_key"
            api-key-location = "header"
            api-key-value = "-" <!-- Set it to hyphen(-) if you want to supply it later using JS -->
          > 
          </rapi-doc>
        </body>
        ...  
      </html>
    ```

    To test it out, provide any API key value on the header and press the blue button. 
    Then click `TRY` button and observe request headers in browser's dev-tools
servers:
paths:
  /api-key:
    get:
      summary: API key from RapiDoc Web Component.
      discription: You can declaratively  provide your own API Key by using `<rapi-doc>` element, and can programatically alter it using JavaScript
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    description: Person Name
                    type: string
                  age:
                    description: Person Age
                    type: integer