Skip to content

Endpoints check #8

@abreaux26

Description

@abreaux26
  • return a single object, if found
  • return the first object in the database in case-sensitive alphabetical order if multiple matches are found
  • allow the user to specify a ‘name’ query parameter
  • allow the user to send one or more price-related query parameters, applicable to items only:
    • min_price=4.99 should look for anything with a price equal to or greater than $4.99
    • max_price=99.99 should look for anything with a price less than or equal to $99.99
  • for items, the user will send EITHER the name parameter OR either/both of the price parameters
    • users should get an error if name and either/both of the price parameters are sent

Valid examples

  • GET /api/v1/merchants/find_one?name=Mart
  • GET /api/v1/items/find_one?name=ring
  • GET /api/v1/items/find_one?min_price=50
  • GET /api/v1/items/find_one?max_price=150
  • GET /api/v1/items/find_one?max_price=150&min_price=50

Invalid examples

  • GET /api/v1//find_one
    • parameter cannot be missing
  • GET /api/v1//find_one?name=
    • parameter cannot be empty
  • GET /api/v1/items/find_one?name=ring&min_price=50
    • cannot send both name and min_price
  • GET /api/v1/items/find_one?name=ring&max_price=5
    • cannot send both name and max_price
  • GET /api/v1/items/find_one?name=ring&min_price=50&max_price=250
    • cannot send both name and min_price and max_price

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions