Widget?

 

 

 

From: <swagger-swaggersocket@googlegroups.com> on behalf of 
"danus...@interblocks.com" <danus...@interblocks.com>
Reply-To: "swagger-swaggersocket@googlegroups.com" 
<swagger-swaggersocket@googlegroups.com>
Date: Friday, May 11, 2018 at 00:43
To: Swagger <swagger-swaggersocket@googlegroups.com>
Subject: Re: How to Use oneOf tag

 

Hi All,

 

I manage to get oneOf tag sorted by upgrading to swagger version 3.0.0. But 
still i have issue in widget: "radio". can any one help me on this.

 




OneOf Tag Reference : https://github.com/OAI/OpenAPI-Specification/issues/333



Thank you in advance.

 







On Friday, May 11, 2018 at 9:34:30 AM UTC+5:30, danu...@interblocks.com wrote: 

Hi All,

 

I need to create add a property with oneOf tag. We are planing to use this for 
Radio button selection. I tried using oneOf tag but i get an error saying 
should NOT have additional properties assitionalProperty: oneOf.

 

Output should be as bellow,

 

pet: { description: "Pet", type: "string", widget: "radio", oneOf: [ { enum: 
["dog"], description: "Dog" }, { enum: ["cat"], description: "Cat" },

{ enum: ["both"], description: "Both" }, ], default:"dog" }



I tried writing as bellow, (i get Errors in widget and onrOf tag)

 

 properties:     
      pet:
        description: Pet
        type: object
        default: dog
        widget: raido
        oneOf:
          - $ref: '#/definitions/dog'
          - $ref: '#/definitions/cat'
          
          
          
 Two Definitions as bellow         
          
dog:
    type: object
    properties:
      id_type:
        type: string
        enum: [dog]
        description: "DOG"
        
cat:
    type: object
    properties:
      id_type:
        type: string
        enum: [cat]
        description: "CAT"





i would appriciate if some one can help me to sort this, Thank you.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to