vdespa / introduction-to-postman-course

956 stars 597 forks source link

Documentation Error: Required Fields in /orders Endpoint Simple Books API #21

Open francoleon08 opened 1 week ago

francoleon08 commented 1 week ago

The documentation states that the fields bookId and customerName are required when submitting a new order. However, I have tested the /orders endpoint and found that an order can be successfully created without providing the customerName.

Steps to Reproduce:

  1. Send a POST request to the /orders endpoint without including the customerName field:

    POST /orders/
    Authorization: Bearer <YOUR TOKEN>
    
    {
     "bookId": 1
    }
  2. Observe that the order is created successfully, even though the customerName is missing.

  3. Check the created orders using the /orders endpoint to confirm the orders are listed without the customerName:

    GET /orders/
    Authorization: Bearer <YOUR TOKEN>
    
    [
       {
           "id": "4s53jrMW4ZdVKp1CElTbN",
           "bookId": 1,
           "createdBy": "5dc5c512ac89bc97ba71d6efbcec3fc59f32f8c15d271a3b07df1e9484244048",
           "quantity": 1,
           "timestamp": 1728079363823
       }
    ]

Expected Behavior: The API should return an error indicating that the customerName field is required.

Actual Behavior: The order is created without the customerName.

Additional Information: It would be helpful to update the documentation to reflect the actual behavior of the API. You can find the documentation here.