2017-01-04 5 views
0

Helfen Sie mir mit Mehrfachantwortkörper mit einzelnem Statuscode im yaml Format.YAML Mehrfache Antwort für einzelnen Statuscode

Ex ::

'401': 
    description: Not Found 
    headers: 
    Content-Type : 
     type: string 
     default: application/json;charset=UTF-8 
    examples: 
    errorCode: '48' 
    errorLabel: RONotAllowed 
    errorDescription: Unable to execute the remote operation as it is not allowed for the vehicle 
'401': 
    description: Not Found 
    headers: 
    Content-Type : 
     type: string 
     default: application/json;charset=UTF-8 
    examples: 
    errorCode: '45' 
    errorLabel: VehicleNotFound 
    errorDescription: Vehicle could not be found using VIN provided in request 
'401': 
    description: Not Found 
    headers: 
    Content-Type : 
     type: string 
     default: application/json;charset=UTF-8 
    examples: 
    errorCode: '49' 
    errorLabel: VehicleAlreadyOnline 
    errorDescription: Unable to execute the remote operation since vehicle is already online 

oben Code i Fehler gefunden ✖ YAML Syntax Error duplizierte Abbildungsschlüssel in Zeile 608, Spalte 9: '401'

Antwort

1

Wenn ich das richtig verstehe Sie sind versuchen, eine Liste von Beispielen für den Fehlercode bereitzustellen. Dazu benötigen Sie:

'401': 
    description: Not Found 
    headers: 
    Content-Type : 
     type: string 
     default: application/json;charset=UTF-8 
    examples: 
    - errorCode: '48' 
     errorLabel: RONotAllowed 
     errorDescription: 'Unable to execute the remote operation as it is not allowed for the vehicle' 
    - errorCode: '45' 
     errorLabel: VehicleNotFound 
     errorDescription: 'Vehicle could not be found using VIN provided in request' 
    - errorCode: '49' 
     errorLabel: VehicleAlreadyOnline 
     errorDescription: 'Unable to execute the remote operation since vehicle is already online' 
+0

ich mit bestimmten Syntax versucht und einen Fehler auf Prahlerei Editor gefunden ** ✖ Swagger Fehler Weitere Objekte nicht erlaubt: 401 ** – Anoop

+0

Ich fürchte, ich weiß nicht, die Prahlerei Editor überhaupt, aber das obige Snippet ist gültig yaml, können Sie es hier überprüfen http://yaml-online-parser.appspot.com/ – mikea

Verwandte Themen