NOAA-OWP / wres

Code and scripts for the Water Resources Evaluation Service
Other
2 stars 1 forks source link

As a user, I want the api and documentation for local server mode on the core application to report correctly #149

Open epag opened 4 weeks ago

epag commented 4 weeks ago

Author Name: James (James) Original Redmine Issue: 123420, https://vlab.noaa.gov/redmine/issues/123420 Original Date: 2023-12-05


Given a post request to a local server instance of the core application, When I post a formatted declaration Then the api should accept this and the documentation should be clear about the expected content type

epag commented 4 weeks ago

Original Redmine Comment Author Name: James (James) Original Date: 2023-12-05T19:15:58Z


Problem begins here:

    @POST
    @Path( "/evaluate" )
    @Produces( MediaType.TEXT_XML )
    public Response postEvaluate( String projectConfig )
    {
</code>

But continues in the wiki and inband documentation, which either does not clarify the content type expected or indicates an incorrect type. The content type should be @text/plain@ to cover both declaration formats.

epag commented 4 weeks ago

Original Redmine Comment Author Name: Evan (Evan) Original Date: 2023-12-06T13:12:05Z


ACK, but based on the description it sounds like the API is not accepting a basic request? There is no expected request type here so it should be accepting everything. I can add the expected recieved and produced types to make things more explicit, but let me know if I am understanding the root problem wrong

epag commented 4 weeks ago

Original Redmine Comment Author Name: James (James) Original Date: 2023-12-06T13:21:19Z


Correct, it is not accepting requests without a @text/xml@ media type as a header argument. Now that I look at the method more closely, I see it @@Produces@ rather than @@Consumes@ the @MediaType.TEXT_XML@. Does it really produce xml, rather than html? Either way, it sounds like jersey is checking against an expected type and failing the request. You can see the http 415 error in #123309-39.

epag commented 4 weeks ago

Original Redmine Comment Author Name: Evan (Evan) Original Date: 2023-12-06T13:37:27Z


Just posted in that other ticket, but I think Hank might just be on an older version of the code. I removed the @@Consumes@ tag in a very recent commit and updated the wiki. If he was not using the most up to date code then he would still need that header. Otherwise nothing should need a header anymore