Rodex_ icon

swagger.json

Rodex_ | PRO | 10/11/18 04:02:31 PM UTC | 0 ⭐ | 254 šŸ‘ļø | Never ā° | []
JSON |

7.86 KB

|

None

|

0 šŸ‘

/

0 šŸ‘Ž

{"swagger":"2.0","info":{"version":"3.0.0","title":"Parcel Logistics Service","description":"Parcel Logistics Service (ASP.NET Core 2.0)","termsOfService":"","contact":{"name":"Maximilian Knor","url":"http://blog.knor.net/","email":""}},"basePath":"/api","paths":{"/parcel/{trackingId}/reportDelivery":{"post":{"tags":["ParcelApi"],"summary":"Report that a Parcel has been delivered at it's final destination address.","operationId":"ReportParcelDelivery","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"trackingId","in":"path","description":"The tracking ID of the parcel. E.g. PYJRB4HZ6","required":true,"type":"string","pattern":"/^[A-Z0-9]{9}$/"}],"responses":{"400":{"description":"The operation failed due to an error.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Error"}},"200":{"description":"Successfully reported hop."},"404":{"description":"Parcel does not exist with this tracking ID."}}}},"/parcel/{trackingId}/reportHop/{code}":{"post":{"tags":["ParcelApi"],"summary":"Report that a Parcel has arrived at a certain hop either Warehouse or Truck.","operationId":"ReportParcelHopArrival","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"trackingId","in":"path","description":"The tracking ID of the parcel. E.g. PYJRB4HZ6","required":true,"type":"string","pattern":"/^[A-Z0-9]{9}$/"},{"name":"code","in":"path","description":"The Code of the hop (Warehouse or Truck).","required":true,"type":"string","pattern":"/^[A-Z]{3}((\\-T\\d{5})|(\\d{2}))$/"}],"responses":{"200":{"description":"Successfully reported hop."}}}},"/parcel":{"post":{"tags":["ParcelApi"],"summary":"Submit a new parcel to the logistics service.","operationId":"SubmitParcel","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"newParcel","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Parcel"}}],"responses":{"200":{"description":"Successfully submitted the new parcel","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.NewParcelInfo"}},"400":{"description":"The operation failed due to an error.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Error"}}}}},"/parcel/{trackingId}":{"get":{"tags":["ParcelApi"],"summary":"Find the latest tracking state of a parcel by its tracking ID.","operationId":"TrackParcel","consumes":[],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"trackingId","in":"path","description":"The tracking ID of the parcel. E.g. PYJRB4HZ6","required":true,"type":"string","pattern":"/^[A-Z0-9]{9}$/"}],"responses":{"200":{"description":"Parcel exists, here's the tracking information.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.TrackingInformation"}},"400":{"description":"The operation failed due to an error.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Error"}},"404":{"description":"Parcel does not exist with this tracking ID."}}}},"/warehouse":{"get":{"tags":["WarehouseApi"],"summary":"Exports the hierarchy of Warehouse and Truck objects.","operationId":"ExportWarehouses","consumes":[],"produces":["text/plain","application/json","text/json"],"responses":{"200":{"description":"Successful response","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Warehouse"}},"400":{"description":"An error occurred loading.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Error"}},"404":{"description":"No hierarchy loaded yet."}}},"post":{"tags":["WarehouseApi"],"summary":"Imports a hierarchy of Warehouse and Truck objects.","operationId":"ImportWarehouses","consumes":["application/json-patch+json","application/json","text/json","application/*+json"],"produces":["text/plain","application/json","text/json"],"parameters":[{"name":"rootWarehouse","in":"body","description":"","required":false,"schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Warehouse"}}],"responses":{"400":{"description":"The operation failed due to an error.","schema":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Error"}},"200":{"description":"Successfully loaded."}}}}},"definitions":{"CodeAssociation.OneLineProject.Services.DTOs.Error":{"description":"","required":["errorMessage"],"type":"object","properties":{"errorMessage":{"description":"The error message.","type":"string"}}},"CodeAssociation.OneLineProject.Services.DTOs.Parcel":{"description":"","required":["weight","receipient"],"type":"object","properties":{"weight":{"format":"float","description":"Gets or Sets Weight","type":"number"},"receipient":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Receipient","description":"Gets or Sets Receipient"}}},"CodeAssociation.OneLineProject.Services.DTOs.Receipient":{"description":"","required":["firstName","lastName","street","postalCode","city"],"type":"object","properties":{"firstName":{"description":"Gets or Sets FirstName","type":"string"},"lastName":{"description":"Gets or Sets LastName","type":"string"},"street":{"description":"Gets or Sets Street","type":"string"},"postalCode":{"description":"Gets or Sets PostalCode","type":"string"},"city":{"description":"Gets or Sets City","type":"string"}}},"CodeAssociation.OneLineProject.Services.DTOs.NewParcelInfo":{"description":"","type":"object","properties":{"trackingId":{"description":"The tracking ID of the parcel.","type":"string"}}},"CodeAssociation.OneLineProject.Services.DTOs.TrackingInformation":{"description":"","required":["state","visitedHops","futureHops"],"type":"object","properties":{"state":{"description":"State of the parcel.","enum":["inTransportEnum","inTruckDeliveryEnum","deliveredEnum"],"type":"string"},"visitedHops":{"description":"Hops visited in the past - either warehouse or truck.","type":"array","items":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.HopArrival"}},"futureHops":{"description":"Hops coming up in the future - their times are estimations.","type":"array","items":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.HopArrival"}}}},"CodeAssociation.OneLineProject.Services.DTOs.HopArrival":{"description":"","required":["code","dateTime"],"type":"object","properties":{"code":{"description":"The code of the warehouse or truck.","type":"string"},"dateTime":{"format":"date-time","description":"The date/time the parcel arrived at the hop.","type":"string"}}},"CodeAssociation.OneLineProject.Services.DTOs.Warehouse":{"description":"","required":["code","description","duration"],"type":"object","properties":{"code":{"description":"Gets or Sets Code","type":"string"},"description":{"description":"Gets or Sets Description","type":"string"},"duration":{"format":"double","description":"Gets or Sets Duration","type":"number"},"nextHops":{"description":"Gets or Sets NextHops","type":"array","items":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Warehouse"}},"trucks":{"description":"Gets or Sets Trucks","type":"array","items":{"$ref":"#/definitions/CodeAssociation.OneLineProject.Services.DTOs.Truck"}}}},"CodeAssociation.OneLineProject.Services.DTOs.Truck":{"description":"","required":["code","numberPlate","latitude","longitude","radius","duration"],"type":"object","properties":{"code":{"description":"Gets or Sets Code","type":"string"},"numberPlate":{"description":"Gets or Sets NumberPlate","type":"string"},"latitude":{"format":"double","description":"Gets or Sets Latitude","type":"number"},"longitude":{"format":"double","description":"Gets or Sets Longitude","type":"number"},"radius":{"format":"double","description":"Gets or Sets Radius","type":"number"},"duration":{"format":"double","description":"Gets or Sets Duration","type":"number"}}}},"securityDefinitions":{}}

Comments