Closed auzil closed 2 years ago
Hi!
Thank you for opening the issue. That's a good catch!
I'm AFK at the moment, but I'll look into it in a day or so.
@auzil
This is a somewhat hacky as there is no method to remove an existing response object, but try activating the following plugin.
https://gist.github.com/moon0326/2cc5b9e997b9f8b64d49c563ba6108b5
wp-content/plugins
Thank you a lot @moon0326, you've saved my day! This snippet does exactly what is needed.
@auzil I'm glad it helped :) I'll go ahead and close this issue in that case. Please open a new issue if you have any other questions.
Hi, The default
/wp/v2/comments
endpoint on the POST request returns response code 201 'Created', so we are trying to hide/override the 200 response code for the admin/json consumer.Code from
Path
class forgenerateOperationsFromRouteArgs
creates the default 200 response ` if ( ! empty( $this->schemaRef ) ) { $content = new ResponseContent( 'application/json', array( '$ref' => $this->schemaRef, ) ); $response = new Response( 200, 'OK' ); $response->addContent( $content ); $responses[] = $response;} else { $responses[] = new Response( 200, 'OK' ); } `
Any advice is appreciated, thank you