cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Example values to API request Fields with description?

Highlighted
New Member

How to set Example values to API request Fields with description?

For Example i have sample api given below 

{
"header": {
"apiversion": "string",
"clientID": "string",
"timeStamp": "string"
},
"request": {}
}

 

I need to add a description to fields. Suppose for API version i need to add ...please provide API version here as description.  How can we do that?

How to add example value to a parameter in swagger?

1 REPLY 1
Highlighted
Moderator

Re: How to set Example values to API request Fields with description?

Hi @mayurw,

 

Use the description keyword to specify property descriptions, and the example keyword to specify example values.

type: object
properties:
  header:
    type: object
    properties:
      apiversion:
        type: string
        description: Please provide API version here   # <-----
        example: '2'          # <-----
      clientId:
        type: string
        example: abcde12345   # <-----
      timeStamp:
        type: string
  request:
    type: object

 


Helen Kosova
SmartBear Documentation Team Lead
________________________
Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Tags (1)
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts