Hi,

I'm using Swagger Online Editor and writing yaml specification.

  "/apis/{name_or_id}/plugins":
    post:
      description: Add Plugin.
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: path
          name: name_or_id
          description: The unique identifier or the name of the API on 
which to add a plugin configuration.
          required: true
          type: string
        - in: body
          name: plugin_data
          description: Data needed to add Plugin.
          required: true
          schema:
            $ref: '#/definitions/PluginData'
      responses:
        '201':
          description: Plugin successfully created.
        '400':
          description: Bad Request. Incorrect or missing parameters.
        '409':
          description: Conflict. Plugin object already exists.

...
definitions:
  KeyAuthPlugin:
    type: object
    properties:
      key_names: 
        type: array
        description: Comma separated parameter names where the plugin will 
look for a key.
          The client must send the authentication key in one of those key 
names.
        items: 
          type: string
          default: apikey
      hide_credentials:
        type: boolean
        description: Tells the plugin to hide the credential to the 
upstream API server. 
          It will be removed by Kong before proxying the request.
      anonymous:
        type: string
        description: Consumer uuid. Value to use as an "anonymous" consumer 
if 
          authentication fails. 
  AclPlugin:
    type: object
    properties:
      whitelist:
        type: array
        description: Comma separated list of arbitrary group names that are 
allowed
          to consume the API. At least one between whitelist or blacklist 
must be 
          specified.
        items:
          type: string
      blacklist: 
        type: array
        description: Comma separated list of arbitrary group names that are 
NOT allowed
          to consume the API. At least one between whitelist or blacklist 
must be 
          specified.
        items:
          type: string
  PluginData:
    type: object
    properties:
      name: 
        type: string
        description: The name of the Plugin that's going to be added.
        enum:
          - key-auth
          - acl
      consumer_id:
        type: string
        description: The unique identifier of the consumer that overrides 
the existing
          settings for this specific consumer on incoming requests.
      config: 
????????????????????????????????????????????????????????????????????????????????????????

In config I'd like to use $ref: '#/definitions/KayAuthPlugin' or 
'#/definitions/AclPlugin' 
depends on the "name" value defined in PluginData which now is enum: 
key-auth or acl. 

*Please advise how to do it. I cannot find solution for my problem since 
oneOf is not implemented in this swagger version.*Best Regards,
Ania

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to