@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Swagger Petstore - OpenAPI 3.0
@base /api/v3
@version 1.0.27
@auth OAuth2 | ApiKey api_key in header
@endpoints 19
@toc pet(8), store(4), user(7)

@group pet
@endpoint PUT /pet
@desc Update an existing pet.
@required {name: str, photoUrls: [str]}
@optional {id: int(int64), category: map{id: int(int64), name: str}, tags: [map{id: int(int64), name: str}], status: str(available/pending/sold) # pet status in the store}
@returns(200) {id: int(int64), name: str, category: map{id: int(int64), name: str}, photoUrls: [str], tags: [map], status: str} # Successful operation
@errors {400: Invalid ID supplied, 404: Pet not found, 422: Validation exception}

@endpoint POST /pet
@desc Add a new pet to the store.
@required {name: str, photoUrls: [str]}
@optional {id: int(int64), category: map{id: int(int64), name: str}, tags: [map{id: int(int64), name: str}], status: str(available/pending/sold) # pet status in the store}
@returns(200) {id: int(int64), name: str, category: map{id: int(int64), name: str}, photoUrls: [str], tags: [map], status: str} # Successful operation
@errors {400: Invalid input, 422: Validation exception}

@endpoint GET /pet/findByStatus
@desc Finds Pets by status.
@required {status: str(available/pending/sold)=available # Status values that need to be considered for filter}
@returns(200) successful operation
@errors {400: Invalid status value}

@endpoint GET /pet/findByTags
@desc Finds Pets by tags.
@required {tags: [str] # Tags to filter by}
@returns(200) successful operation
@errors {400: Invalid tag value}

@endpoint GET /pet/{petId}
@desc Find pet by ID.
@required {petId: int(int64) # ID of pet to return}
@returns(200) {id: int(int64), name: str, category: map{id: int(int64), name: str}, photoUrls: [str], tags: [map], status: str} # successful operation
@errors {400: Invalid ID supplied, 404: Pet not found}

@endpoint POST /pet/{petId}
@desc Updates a pet in the store with form data.
@required {petId: int(int64) # ID of pet that needs to be updated}
@optional {name: str # Name of pet that needs to be updated, status: str # Status of pet that needs to be updated}
@returns(200) {id: int(int64), name: str, category: map{id: int(int64), name: str}, photoUrls: [str], tags: [map], status: str} # successful operation
@errors {400: Invalid input}

@endpoint DELETE /pet/{petId}
@desc Deletes a pet.
@required {petId: int(int64) # Pet id to delete}
@optional {api_key: str}
@returns(200) Pet deleted
@errors {400: Invalid pet value}

@endpoint POST /pet/{petId}/uploadImage
@desc Uploads an image.
@required {petId: int(int64) # ID of pet to update}
@optional {additionalMetadata: str # Additional Metadata}
@returns(200) {code: int(int32), type: str, message: str} # successful operation
@errors {400: No file uploaded, 404: Pet not found}

@endgroup

@group store
@endpoint GET /store/inventory
@desc Returns pet inventories by status.
@returns(200) successful operation

@endpoint POST /store/order
@desc Place an order for a pet.
@optional {id: int(int64), petId: int(int64), quantity: int(int32), shipDate: str(date-time), status: str(placed/approved/delivered) # Order Status, complete: bool}
@returns(200) {id: int(int64), petId: int(int64), quantity: int(int32), shipDate: str(date-time), status: str, complete: bool} # successful operation
@errors {400: Invalid input, 422: Validation exception}

@endpoint GET /store/order/{orderId}
@desc Find purchase order by ID.
@required {orderId: int(int64) # ID of order that needs to be fetched}
@returns(200) {id: int(int64), petId: int(int64), quantity: int(int32), shipDate: str(date-time), status: str, complete: bool} # successful operation
@errors {400: Invalid ID supplied, 404: Order not found}

@endpoint DELETE /store/order/{orderId}
@desc Delete purchase order by identifier.
@required {orderId: int(int64) # ID of the order that needs to be deleted}
@returns(200) order deleted
@errors {400: Invalid ID supplied, 404: Order not found}

@endgroup

@group user
@endpoint POST /user
@desc Create user.
@optional {id: int(int64), username: str, firstName: str, lastName: str, email: str, password: str, phone: str, userStatus: int(int32) # User Status}
@returns(200) {id: int(int64), username: str, firstName: str, lastName: str, email: str, password: str, phone: str, userStatus: int(int32)} # successful operation

@endpoint POST /user/createWithList
@desc Creates list of users with given input array.
@returns(200) {id: int(int64), username: str, firstName: str, lastName: str, email: str, password: str, phone: str, userStatus: int(int32)} # Successful operation

@endpoint GET /user/login
@desc Logs user into the system.
@optional {username: str # The user name for login, password: str # The password for login in clear text}
@returns(200) successful operation
@errors {400: Invalid username/password supplied}

@endpoint GET /user/logout
@desc Logs out current logged in user session.
@returns(200) successful operation

@endpoint GET /user/{username}
@desc Get user by user name.
@required {username: str # The name that needs to be fetched. Use user1 for testing}
@returns(200) {id: int(int64), username: str, firstName: str, lastName: str, email: str, password: str, phone: str, userStatus: int(int32)} # successful operation
@errors {400: Invalid username supplied, 404: User not found}

@endpoint PUT /user/{username}
@desc Update user resource.
@required {username: str # name that need to be deleted}
@optional {id: int(int64), username: str, firstName: str, lastName: str, email: str, password: str, phone: str, userStatus: int(int32) # User Status}
@returns(200) successful operation
@errors {400: bad request, 404: user not found}

@endpoint DELETE /user/{username}
@desc Delete user resource.
@required {username: str # The name that needs to be deleted}
@returns(200) User deleted
@errors {400: Invalid username supplied, 404: User not found}

@endgroup

@end
