-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy ModelResource schema to route request schema with extra fields #174
Comments
Does the example you give below not work? You would want to give the route another name of course. |
EDIT: So it turns out I needed to set
Okay so, here is an example schema output for this route
here is the defined request schema
I've also tried using just fields.Object
When I submit this payload as an example
I get this error response
if I send an empty object as the extract, for example
It submits fine, and if you print the passed argument, you see "taxonomy_id" 1 and a fully filled in object that matches inline(self) but all values set to None.
but
You can post to its |
That would be the expected input. You are posting an empty object and getting an empty resolved object as an argument. What input are you looking for in this situation? |
That was just an example of me debugging the situation, not what I wanted. I want to use like the following
However, when I send the following payload.
It works now, so I suppose this can be closed. The original error message was confusing to me and I was unaware of the patch attribute on |
I'm wondering if there is a way, to copy the schema from a
ModelResource
(Inline('self)
) but add some extra fields onto it for another definedRoute
within that Resource, specifically the request_schema for said route.The reasoning behind this, is that I have a route that requires the exact same properties as say, the
create
route, however I have a few extra ones required. This would just save having to duplicate writing out a fieldSet with all the properties from that model, just to include an extra one, and I dont want to include these extra fields on theSchema
of the resource, as these are only related to this specific route and not the model.Some way to do something even like
The text was updated successfully, but these errors were encountered: