Forum Discussion

Pi_Network's avatar
Pi_Network
Regular Visitor
4 years ago
Solved

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

 

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

1 Reply

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    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.