moon0326
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Activating WooCommerce causes mass calls and crashes websitesFor those encountering the issue, could you please share your system status if it’s still active? I’m finding it difficult to replicate the problem with my setup.
- This reply was modified 10 months, 1 week ago by moon0326.
Forum: Developing with WordPress
In reply to: Many REST API schemas do not match their response contents@bcworkz Thank you! I did not know about Trac system.
Forum: Developing with WordPress
In reply to: Many REST API schemas do not match their response contentsIf the returned schema doesn’t match its endpoint, it’s not possible to build a tool and “we are returned the schema of our API, enabling others to write client libraries to interpret our data” is false in that case because those tools need to guess the type of endpoints — object or array.
Let’s say I’m building a mock server using schema and I want to provide a mock endpoint for the posts. It’s not possible to build the tool without mapping the endpoint’s type.
posts => collection
post => item> Since being RESTful is all about resources, I believe defining the resource’s schema and not the response itself is proper.
We can have both, and that’s what other tools such as OpenAPI (aka Swagger) choose to.
Once you define a resource (Post in this case), you can reuse it as if it’s a model.
{ "type": "array", "items": { "$ref": "#/schmea/Post" } }
Maybe I should open a PR and see what others think ??
Forum: Developing with WordPress
In reply to: Many REST API schemas do not match their response contents@bcworkz According to https://developer.www.ads-software.com/rest-api/extending-the-rest-api/schema/, OPTIONS calls are supported. You can try OPTIONS for most wp/v2 endpoints.
I’m trying to use schema from OPTIONS calls to build a tool, but having hard time because returned schemas do not match responses.
From https://developer.www.ads-software.com/rest-api/extending-the-rest-api/schema/, it says the following
“we are returned the schema of our API, enabling others to write client libraries to interpret our data”
This isn’t true since schema doesn’t match the response. There needs guessing work to work with schemas
I’m trying to see if WP community is aware of it. If so, if this is intentional.
Hi @ashkanahmadi,
Since the orders data are stored in the tables, it’s best to keep the tables if you intend to keep the orders data.
You can optionally export the tables and restore them back when needed.
Thanks,
Moon