It’s not valid. The example should be the same type as the property itself.

 

 

 

From: <[email protected]> on behalf of Murali Krishna 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Wednesday, 21 June 2017 at 13:59
To: Swagger <[email protected]>
Subject: Question related to Swagger Spec

 

Hi, 

 

We are using a Swagger 2.0 spec and it has a response entity with an integer 
property with a string example as below

 

 "person": {

      "type": "object",

      "properties": {

        "age": {

          "type": "integer",

          "description": "Persons age",

          "example": "10000"

        }

      }

   }

 

Is it valid to define example with a String when the type of property is 
integer?

Should the actual API return an integer or String if this is the case?

 

Thanks,

Murali

-- 
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.


-- 
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