Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft/3803 multiple responses using one of attribute do not appear in ui #5530

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

VIIgit
Copy link

@VIIgit VIIgit commented Aug 14, 2019

Description

Display oneOf/anyOf schema in Example View.

  1. Appears only on OAS3 specifications (obviously) and if an oneOf/anyOf structure is present on RequestBody or on Response
  2. By default the first oneOf/anyOf item is shown to keep the UI noise at a minimum
  3. Option to manually select oneOf/anyOf item
  4. config option to switch feature on/off (showAlternativeSchemaExample: false)
    • could be removed in case the feature becomes standard
    const ui = SwaggerUIBundle({
        ....
        showAlternativeSchemaExample: true,
        ...
  1. Supports and covered with test cases
  • oneOf:

    • of objects: example default: selects first item
    • of primitive data types: example default: selects first item
    • of arrays with oneOf subschemas: example default: selects first item
    • of arrays of an object with an oneOf subschema: example default: object with first item of subschema
    • uses discriminator's mapping values as example Swagger Inheritance and Polymorphism
  • anyOf:

    • of objects: example default: selects first item
    • of primitive data types: example default: selects first item
    • of arrays with anyOf subschemas: all items are shown as example value
    • of arrays of an object with an anyOf subschema: example default: object with first item of subschema
  • Not yet supported/considered:

    • oneOf/anyOf of arrays of an object with an oneOf/anyOf subschema: all permutation of an oneOf/anyOf could be listed
    • random selection or round-robin selection (is a bit non-deterministic and UI is leaner without)

Motivation and Context

Fixes #3803 Multiple responses using oneOf attribute do not appear in UI

How Has This Been Tested?

Swagger to demonstrate the feature

openapi: 3.0.1
info:
  title: OneOf examples
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  version: 1.0.0
servers: 
 - url: localhost
paths:

  /delivery-addresses/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    patch:
      summary: Update delivery address
      operationId: patchDeleiverAddress
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeliveryAddress'
          application/xml:
            schema:
              $ref: '#/components/schemas/DeliveryAddress'
      responses:
        '200':
          description: successful operation
          x-content:
            application/hal-form+json:
              schema:
                type: object
              x-schemaRef: '#/components/schemas/DeliveryAddress'

    get:
      summary: Read delivery address
      operationId: getDeliveryAddress
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryAddress'

components:
  schemas:
    DeliveryAddress:
      type: object
      title: Delivery Address
      description: OneOf Example
      properties:
        address:
          type: string
        city:
          type: string
        options:
          oneOf:
            - type: object
              title: Delivery Express
              required:
                - company
              properties:
                company:
                  type: string              
                shipping:
                  type: string
                  default: STANDARD
                  example: STANDARD
                  enum:
                    - FAST
                    - STANDARD
            - type: object
              title: Parcel Quick
              required:
                - company
              properties:
                company:
                  type: string
                remarks:
                  type: string
        options2:               
          anyOf:
            - type: object
              title: US
              properties:
                state:
                  type: string
                zipCode:
                  type: string
              required:
                - zipCode
                - state
            - type: object
              title: Europe
              properties:
                county:
                  type: string
                postCode:
                  type: string
              required:
                - postCode  
 

Screenshots:

IMG_4872

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@AlexNik
Copy link

AlexNik commented Sep 11, 2019

Merge it please!

@hannes-ucsc
Copy link

Is this intended to only work with oneOf or anyOf as a child of a property definition like in the example above?

type: "object"
properties:
    "options":
        oneOf: 
            - 
            - 
        

oneOf/anyOf can appear at the top level of a schema, too.

type: "object"
oneOf:
    - 
    - 

@VIIgit
Copy link
Author

VIIgit commented Sep 13, 2019

oneOf/anyOf at the top level
oneOf

openapi: 3.0.1
info:
  title: OneOf examples
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  version: 1.0.0
servers: 
 - url: localhost
paths:

  /delivery-addresses/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
    patch:
      summary: Update delivery address
      operationId: patchDeleiverAddress
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeliveryAddress'
          application/xml:
            schema:
              $ref: '#/components/schemas/DeliveryAddress'
      responses:
        '200':
          description: successful operation
          x-content:
            application/hal-form+json:
              schema:
                type: object
              x-schemaRef: '#/components/schemas/DeliveryAddress'

    get:
      summary: Read delivery address
      operationId: getDeliveryAddress
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryAddress'

components:
  schemas:
    DeliveryAddress:
      oneOf:
      - type: object
        title: Online Delivery
        properties:
          email:
            type: string     
            example: [email protected] 
      - type: object
        title: Delivery Address
        description: OneOf Example
        properties:
          address:
            type: string
          city:
            type: string
          options:
            oneOf:
              - type: object
                title: Delivery Express
                required:
                  - company
                properties:
                  company:
                    type: string              
                  shipping:
                    type: string
                    default: STANDARD
                    example: STANDARD
                    x-oneOf:
                      - const: FAST
                        title: 24h + EUR 40
                      - const: STANDARD
                        title: 3-5 Days
              - type: object
                title: Parcel Quick
                required:
                  - company
                properties:
                  company:
                    type: string
                    x-const: PQ
                  remarks:
                    type: string
          options2:               
            oneOf:
              - type: object
                title: US
                properties:
                  state:
                    type: string
                  zipCode:
                    type: string
                required:
                  - zipCode
                  - state
              - type: object
                title: Europe
                properties:
                  county:
                    type: string
                  postCode:
                    type: string
                required:
                  - postCode  
  

@hannes-ucsc
Copy link

hannes-ucsc commented Sep 14, 2019

Interesting. I tried your branch on my spec and couldn't get it to work. Is it because the children of my oneOf are $ref or because the parent schema has properties as well?

@VIIgit
Copy link
Author

VIIgit commented Sep 14, 2019

Interesting. I tried your branch on my spec and couldn't get it to work. Is it because the children of my oneOf are $ref or because the parent schema has properties as well?

Upps, interesting! I'll try to consider your scenario as well...

@VIIgit
Copy link
Author

VIIgit commented Sep 23, 2019

Interesting. I tried your branch on my spec and couldn't get it to work. Is it because the children of my oneOf are $ref or because the parent schema has properties as well?

Hi Hannes,

your use case works now too:
2019-09-23 um 3 06 37 PM

@hannes-ucsc
Copy link

Cool! What do you think about adding support for discriminator? With my spec this would eliminate the issue that the example value for integration_type does not change depending on the selected alternative.

Also noticed that for lists of documents whose schema has a oneOf, the examples only represent a partial set of properties.

Screen Shot 2019-09-23 at 12 14 14 PM

The "manually selected" UI element also doesn't populate a list of alternatives but I'm not sure that is needed here. It may make more sense to simply select the first alternative for the first document, the second alternative for the second document and so on.

@hannes-ucsc
Copy link

The above screen shot is from the 200 response for the GET /portal/{portal_id}/integration path in my spec.

@miroslavKovacPantheon
Copy link

Hi @shockey,

could you please look at this patch and give it some review so @VIIgit could finish it. Or merge it please if it is in a shape that it can go to this project.

Thank you

@desponda
Copy link

desponda commented May 16, 2020

please look at this PR @shockey @webron

@miroslavKovacPantheon
Copy link

Hello

@desponda I am very greatfull for your review. It is finally moving along.

@VIIgit do you thing that now you would be able to move on to xml generation as well?

Thank you

@webpro
Copy link
Contributor

webpro commented May 18, 2020

@desponda I think I'm incorrectly mentioned here :-)

@soberich
Copy link

+1 for xml!
I've added syntax highlight in this PR from another PR in case anyone wants to play with it.
Please note! It has opionated index.html which suits my use case.

https://bintray.com/soberich/maven/com.github.soberich%3Aswagger-ui

@eLvErDe
Copy link

eLvErDe commented May 22, 2020

Great to see some activities around :-)

@faraazbrcm
Copy link

faraazbrcm commented May 22, 2020

Hi @VIIgit Thanks for taking the time and implementing a solution for oneOf directive.
I have tested your PR. It seems to be working for some scenario of payload but not for some. One of the sample where it is not working is below

Not Working schema

patch_openconfig_system_system_ntp_servers: allOf: - type: object properties: openconfig-system:servers: type: object properties: server: type: array items: type: object required: - address properties: address: oneOf: - oneOf: - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ x-yang-type: string - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ x-yang-type: string - maxLength: 253 minLength: 1 type: string x-length: 1..253 x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ && ((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\. x-yang-type: string config: type: object properties: address: oneOf: - oneOf: - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ x-yang-type: string - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ x-yang-type: string - maxLength: 253 minLength: 1 type: string x-length: 1..253 x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ && ((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\. x-yang-type: string port: default: 123 format: int32 maximum: 65535 minimum: 0 type: integer x-yang-type: uint16 version: default: 4 format: int32 maximum: 4 minimum: 1 type: integer x-range: 1..4 x-yang-type: uint8 association-type: default: SERVER enum: - SERVER - PEER - POOL maxLength: 18446744073709551615 minLength: 0 type: string x-yang-type: string iburst: default: 'false' format: boolean type: boolean x-yang-type: boolean prefer: default: 'false' format: boolean type: boolean x-yang-type: boolean

Scenario where is it working

post_list_openconfig_system_system_ntp_servers_server: allOf: - type: object properties: openconfig-system:server: type: array items: type: object required: - address properties: address: oneOf: - oneOf: - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ x-yang-type: string - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ x-yang-type: string - maxLength: 253 minLength: 1 type: string x-length: 1..253 x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ && ((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\. x-yang-type: string config: type: object properties: address: oneOf: - oneOf: - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ x-yang-type: string - maxLength: 18446744073709551615 minLength: 0 type: string x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ x-yang-type: string - maxLength: 253 minLength: 1 type: string x-length: 1..253 x-pattern: ^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$ && ^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$ && ((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)|\. x-yang-type: string port: default: 123 format: int32 maximum: 65535 minimum: 0 type: integer x-yang-type: uint16 version: default: 4 format: int32 maximum: 4 minimum: 1 type: integer x-range: 1..4 x-yang-type: uint8 association-type: default: SERVER enum: - SERVER - PEER - POOL maxLength: 18446744073709551615 minLength: 0 type: string x-yang-type: string iburst: default: 'false' format: boolean type: boolean x-yang-type: boolean prefer: default: 'false' format: boolean type: boolean x-yang-type: boolean

@VIIgit
Copy link
Author

VIIgit commented May 22, 2020

Hi @faraazbrcm
could you provide me your example as OpenAPI or not as prose text? it's hard to read for humans ;)

@patrickelectric
Copy link

Any plan to get this merged ? :)

@alex1987
Copy link

Any update on whether this could get merged? We came up against this limitation recently and it would be really nice to have this supported.

@dylanhsieh
Copy link

I really need this fix, please merge it.

@ivanchurkin
Copy link

ping

@vincentchalamon
Copy link

May also solve #6540

@adammkelly
Copy link

Any idea when this will merge?

@hannes-ucsc
Copy link

For goodness sake, maintainers, speak up!

If lack of XML support is holding this up, please reconsider. Who cares if this improvement is only available for JSON, not XML? Right now its implemented for neither so this would be a clear improvement. Omitting XML support does not accrue any new debt so insisting that it be added make no sense.

In my opinion.

@JonFranchi
Copy link

Are there any plans to merge and release this anytime soon?

@hpl002
Copy link

hpl002 commented Mar 18, 2021

Please supply us with an update on this.

The feature request has been dragging on for 3+ years...

@soberich
Copy link

They are probably too busy redistributing profits from becoming a specification still.

Maybe the phrase will get attention to get this merged )

@dsych
Copy link

dsych commented May 11, 2021

@VIIgit it's sad to see this awesome work go to waste... have you considered turning this into a plugin instead of a base preset? then people would be able to actually use this without depending on swagger-ui

@VIIgit
Copy link
Author

VIIgit commented May 12, 2021

@VIIgit it's sad to see this awesome work go to waste... have you considered turning this into a plugin instead of a base preset? then people would be able to actually use this without depending on swagger-ui

Yes, I've started with a plugin, but it was not possible due to missing or not accessible context data within the plugin. So I've decided to fix it in the core.
I also believe a plugin could be beneficial, but I would need more context data to provide a perfect solution. To improve that is may be again waste of time.

@dsych
Copy link

dsych commented May 12, 2021

@VIIgit it's sad to see this awesome work go to waste... have you considered turning this into a plugin instead of a base preset? then people would be able to actually use this without depending on swagger-ui

Yes, I've started with a plugin, but it was not possible due to missing or not accessible context data within the plugin. So I've decided to fix it in the core.
I also believe a plugin could be beneficial, but I would need more context data to provide a perfect solution. To improve that is may be again waste of time.

When you say "context data" what do you mean exactly?
Also I disagree that re-writing this as a plugin would be a waste of time if only judging by the number of comments on this PR :) People definitely want this feature, but I see how this would be discouraging for you given the state of this PR.

@hannes-ucsc
Copy link

I envy your patience, Erwin.

@perry-autofi
Copy link

+1
I'm having the same issue. Would love to see this merged.

@KminekMatej
Copy link

+1 , and dont undestand why this 3 yeas old bug isnt fixed, when there are clearly pull requests pending ..

@RaffaeleSp
Copy link

+1, is there any timeline for the above merge proposal?

Thank you

@StephenOTT
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple responses using oneOf attribute do not appear in UI