Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
francoleon08 opened this issue Oct 4, 2024 · 0 comments

Comments

@francoleon08
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant