Closed jordanpadams closed 3 years ago
Update engineering details on this ticket:
Note: If this is not possible, I would like us to disable the XML response format until NASA-PDS/registry-api#456 is implemented. Most of our users will use the swagger page for initial testing, and we need to limit how much visibility comes to that response format until it is in a mort robust state.
@jordanpadams @tloubrieu-jpl
The two URLs in the accept give me 404 errors (used my local registry-api-service with one of them but fails the same as pds.nasa.gov version):
$ curl -X GET "http://localhost:8080/api/products"
{"timestamp":1628103468072,"status":404,"error":"Not Found","message":"","path":"/api/products"}
$ curl -X GET "https://pds.nasa.gov/api/swagger-ui.html"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>
Hi @al-niessner ,
I updated the url in the ticket description. sorry about that.
@al-niessner
Just to make sure we share the same understanding of the ticket, the request with curl already returns json format, it is the default from the server point of view.
The issue is that the browser (google chorme), sets a default accept to application/html and the server believes the best fit is application/xml whereas we want to return application/json. Maybe for that case, we shoud just accept application/html and return json. That will be defined from this section of the code https://github.com/NASA-PDS/registry-api-service/blob/45798b880a7229e4923f85e2d25e4ee0c59bae1d/src/main/java/gov/nasa/pds/api/engineering/configuration/WebMVCConfig.java#L89
For the swagger ui, I have no idea how to change that but there might be a configuration that you will find.
thanks,
@tloubrieu-jpl
Is this a registry-api-service thing? When I do it locally (http://localhost:8080/api/products
) it returns 404 with this error in the registry-api-service:
2021-08-04 19:14:06.823 DEBUG 58 --- [0.3-8080-exec-8] o.s.web.servlet.DispatcherServlet : GET "/api/products", parameters={}
2021-08-04 19:14:06.823 DEBUG 58 --- [0.3-8080-exec-8] pertySourcedRequestMappingHandlerMapping : looking up handler for path: /api/products
2021-08-04 19:14:06.824 WARN 58 --- [0.3-8080-exec-8] o.s.web.servlet.PageNotFound : No mapping for GET /api/products
2021-08-04 19:14:06.824 DEBUG 58 --- [0.3-8080-exec-8] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND
Hi @al-niessner When on a dev environment, you should remove /api (the /api is part of the base url on pds-gamma, through an apache reverse proxy). So url http://localhost:8080/products shoud work in your dev environement.
Motivation
...so that I no longer allow responses from response formats that have not yet been sufficiently designed/implemented.
Additional Details
Acceptance Criteria
Given a deployed registry-api-service with data ingested When I perform a query of the API from a browser (e.g. https://pds-gamma.jpl.nasa.gov/api/products) Then I expect the response will be an error message indicating XML/HTML is not supported
Engineering Details
Note: If this is not possible, I would like us to disable the XML response format until NASA-PDS/registry-api#456 is implemented. Most of our users will use the swagger page for initial testing, and we need to limit how much visibility comes to that response format until it is in a mort robust state.