cancel
Showing results for 
Search instead for 
Did you mean: 

What does <*> symbol represent in json swagger?

SOLVED
Pi_Network
Frequent Visitor

What does <*> symbol represent in json swagger?

I have a question in JSON swagger. May I know what does <*> symbol represent in JSON swagger?

This is how the format looks like after I import the JSON swagger into the online editor. What does <*> actually mean?

 

CrossCurrencyRequest{
items*  {
 
    < * >:  CurrencyPairRequest{
                amount* number


                currencyPair*   string

                decimalPlace    integer($int32)
             
            }
        } 
}

Below are the definitions from the swagger file.

 

definitions:
  CrossCurrencyRequest:
    type: object
    required:
      - items
    properties:
      items:
        type: object
        additionalProperties:
          $ref: '#/definitions/CurrencyPairRequest'
    title: CrossCurrencyRequest
    

I have the sample request as given below. How to make the request generates the "key1", "key2", etc? As it seems like not a predefined object from the swagger file.

 

Sample request:
{
                "items": {
                                "key1": {
                                                "amount": 1000.123456789,
                                                "currencyPair": "USD-SGD",
                                                "decimalPlace": 5
                                },
                                "key2": {
                                                "amount": 1000.12345,
                                                "currencyPair": "USD-IDR"
                                },
                                "key3": {
                                                "amount": 1000.12345,
                                                "currencyPair": "USD-ZNH"
                                }
                }
}

 

1 ACCEPTED SOLUTION

Accepted Solutions
HKosova
Moderator

Re: What does <*> symbol represent in json swagger?

In Swagger UI schema viewer, <*> represents arbitrary key names in a dictionary/map. In your example, the items property is dictionary/map where the keys are arbitrary strings and the values are CurrencyPairRequest objects.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

1 REPLY 1
HKosova
Moderator

Re: What does <*> symbol represent in json swagger?

In Swagger UI schema viewer, <*> represents arbitrary key names in a dictionary/map. In your example, the items property is dictionary/map where the keys are arbitrary strings and the values are CurrencyPairRequest objects.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors