Closed TristanSpeakEasy closed 7 months ago
After attempting to solve this, I was confused as to why the correct path could not be found.
The http.Request.URL.Fragment
was always missing when making a curl request or via postman etc. I was unable to perform any kind of lookup when a fragment was used, because any request made to wiretap using a fragment was just missing the fragment each time.
So then I looked a little deeper. I found this:
https://github.com/golang/go/issues/3805
Fragments are never sent in HTTP. They're purely a local browser concept.
There is no way for me determine which path is being requested when the OpenAPI specification uses a fragment as a delimiter. The fragment is never picked up by the standard library.
Which pulls into question the legitimacy of using fragments at all in OpenAPI specs. They are quite useless it seems and should not be used as delimiters for paths.
Marking this as a wontfix, because there is nothing I can do to make it work.
Consider this spec:
When sending the request body like so:
I get this error from wiretap:
I believe this is related to https://github.com/pb33f/wiretap/issues/78
Basically I think its validating against the wrong operation and it seems to be non-deterministic (prob due to map order in Go) as sometimes I start wiretap and it works and sometimes I start it and it doesn't work.
I imagine this would be sorted by looping through all operations that match the path instead of just the first found?