{"openapi":"3.0.4","info":{"title":"Apartment Search","description":"API to persist and query apartment set data.","version":"0.1.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/lhyltoncsorganizatio/ApartmentSearch/0.1.0"},{"url":"http://localhost:3000/","description":"Local Development"},{"url":"https://lwhylton.com/","description":"production server"}],"security":[{"BearerAuth":["read","write"]}],"paths":{"/building":{"get":{"summary":"Returns all buildings.","tags":["/building"],"responses":{"200":{"description":"A json array of buildings.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Building"}}}}},"400":{"description":"Bad request."},"5XX":{"description":"Unexpected error."}}},"post":{"summary":"Add a new building.","tags":["/building"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildingInput"}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Bad Request."},"5XX":{"description":"Internal Server Error."}}}},"/building/{buildingId}":{"get":{"summary":"Returns a single building.","tags":["/building"],"parameters":[{"in":"path","name":"buildingId","schema":{"type":"integer"},"required":true,"description":"Numeric ID of the building to get"}],"responses":{"200":{"description":"A json building object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"400":{"description":"Bad request."},"404":{"description":"building with buildingId not found."},"5XX":{"description":"Unexpected error."}}}},"/building/{buildingId}/floorplans/current":{"get":{"summary":"Returns a single building with current floor plans.","tags":["/building"],"parameters":[{"in":"path","name":"buildingId","schema":{"type":"integer"},"required":true,"description":"Numeric ID of the building to get"}],"responses":{"200":{"description":"A json building object with floor plans.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildingWithFloorPlans"}}}},"400":{"description":"Bad request."},"404":{"description":"building with buildingId not found."},"5XX":{"description":"Unexpected error."}}}},"/set":{"post":{"summary":"Add a new Apartment Set.","tags":["/set"],"requestBody":{"description":"Optional description in *Markdown*","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetInput"}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Bad request."},"5XX":{"description":"Unexpected error."}}},"get":{"summary":"Get all apartment sets.","tags":["/set"],"responses":{"200":{"description":"A json list of apartment sets.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApartmentSet"}}}}}}}},"/set/{setId}":{"get":{"summary":"Get a full apartment set by id.","tags":["/set"],"parameters":[{"in":"path","name":"setId","schema":{"type":"integer"},"required":true,"description":"Numeric ID of the apartment set to get"}],"responses":{"200":{"description":"A json object containing the full apartment set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApartmentSetFull"}}}}}},"delete":{"summary":"Delete an apartment set.","tags":["/set"],"parameters":[{"in":"path","name":"setId","schema":{"type":"integer"},"required":true,"description":"Numeric ID of the apartment set to delete"}],"responses":{"200":{"description":"Deleted"}}}},"/auth/login":{"post":{"summary":"Login","tags":["/auth"],"requestBody":{"description":"Optional description in *Markdown*","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Successful Login","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}}}}},"404":{"description":"User not found."},"400":{"description":"Invalid Credentials"},"500":{"description":"Internal Server Error"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"Bearer"}},"schemas":{"Building":{"type":"object","properties":{"buildingId":{"type":"integer"},"name":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"neighborhood":{"type":"string"},"url":{"type":"string"}}},"BuildingInput":{"type":"object","properties":{"name":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"neighborhood":{"type":"string"},"url":{"type":"string"}}},"BuildingWithFloorPlans":{"type":"object","properties":{"buildingId":{"type":"integer"},"name":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"neighborhood":{"type":"string"},"url":{"type":"string"},"floorPlans":{"type":"array","items":{"$ref":"#/components/schemas/FloorPlan"}}}},"FloorPlan":{"type":"object","properties":{"floorPlanId":{"type":"integer"},"buildingId":{"type":"integer"},"setId":{"type":"integer"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/FloorPlanType"},"bathroomCount":{"type":"number"},"squareFootage":{"type":"number"},"startingPrice":{"type":"number"},"url":{"type":"string"}}},"FloorPlanType":{"type":"string","enum":["Studio","OneBedroom","TwoBedroom","ThreeBedroom","FourBedroom"]},"SetFloorPlanInput":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"integer","enum":[0,1,2,3,4]},"bathrooms":{"type":"number"},"squareFootage":{"type":"number"},"startingPrice":{"type":"number"},"url":{"type":"string"}}},"SetBuildingInput":{"type":"object","properties":{"name":{"type":"string"},"floorPlans":{"type":"array","items":{"$ref":"#/components/schemas/SetFloorPlanInput"}}}},"SetInput":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"buildlings":{"type":"array","items":{"$ref":"#/components/schemas/SetBuildingInput"}}}},"ApartmentSet":{"type":"object","properties":{"setId":{"type":"integer"},"timestamp":{"type":"string","format":"date-timestamp"}}},"ApartmentSetFull":{"type":"object","properties":{"setId":{"type":"integer"},"timestamp":{"type":"string","format":"date-timestamp"},"buildings":{"type":"array","items":{"$ref":"#/components/schemas/BuildingWithFloorPlans"}}}}}}}