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

curl results in a 404 Not Found #47

Open
slecholineas opened this issue Jun 5, 2020 · 4 comments
Open

curl results in a 404 Not Found #47

slecholineas opened this issue Jun 5, 2020 · 4 comments

Comments

@slecholineas
Copy link

I'm able to start openapi-mock with openapi-mock.exe serve --specification-url customers-v1.0.0-openapi3.yaml and the attached YAML. "curl http://localhost:8080/financial/v1/customers/XP" results however in a "404 Not Found". What am I doing wrong ?

customers-v1.0.0-openapi3.yaml.txt

@strider2038
Copy link
Collaborator

@slecholineas thank you for the report! You can see details about the error in logs.

Route 'GET /financial/v1/customers/XP' does not pass validation: Parameter 'modifiedSince' in query has an error: must have a value: must have a value

It seems that the query parameter modifiedSince is required for URL.

- in: query
  name: modifiedSince
  required: true

If you send curl http://localhost:8080/financial/v1/customers/XP?modifiedSince=2020-01-01T00:00:00 you will see the correct response from the server.

I think that the server should respond with "400 Bad request". I will fix this behaviour.

@slecholineas
Copy link
Author

@strider2038 now it works, thanks for your help.

@ahofmeister
Copy link

@strider2038 As far as I know, if a query parameter was misspelled or something similar, a 404 is correct. See: https://stackoverflow.com/questions/51676598/http-404-vs-400-for-invalid-query-parameters

@jkone27
Copy link

jkone27 commented Aug 9, 2023

i get just 404s without much reasons on why it cannot match, also it would be useful if the mock server loaded in it's root page or in some logs, all the loaded configurations and available paths from root that can be called and methods that can be used..

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

4 participants