You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please verify that this bug has NOT been raised before.
I checked and didn't find a similar issue
Describe the bug*
I can work with pretty much any language I can set up an IDE for, but my language of choice for anything complex is likely to be Java. I've been running SQL queries to pull data directly from my InvenTree database, but that's obviously not ideal.
Given that there's an OpenAPI schema published for InvenTree, I figured it would be straightforward to generate a Java library so I could pull data from my InvenTree instance (particularly SalesOrder data). Unfortunately, the schema-generated code doesn't support the response I get back from the server.
Running a query for order 1 against the order_so_retrieve operation on my dev server with the test data loaded I get the following error (edited to add line breaks for readability):
java.lang.IllegalArgumentException:
The field `notes` in the JSON string is not defined in the `SalesOrder` properties.
JSON: {
"pk":1,
"created_by":{"pk":1,"username":"admin","first_name":"","last_name":"","email":""},
"creation_date":"2021-11-17",
"start_date":null,
"target_date":null,
"description":"Selling some stuff",
"line_items":1,
"completed_lines":1,
"link":"",
"project_code":null,
"project_code_detail":null,
"reference":"SO0001",
"responsible":6,
"responsible_detail":{"pk":6,"owner_id":3,"name":"engineer","label":"user"},
"contact":null,
"contact_detail":null,
"address":null,
"address_detail":null,
"status":20,
"status_text":"Shipped",
"status_custom_key":20,
"notes":"",
"barcode_hash":"",
"overdue":false,
"customer":30,
"customer_reference":"",
"shipment_date":"2022-09-07",
"total_price":"150.000000",
"order_currency":null,
"shipments_count":1,
"completed_shipments_count":1
}
Inspecting the SalesOrder schema definition I can verify that notes is not in the schema, but I can also see that some fields are null that the schema lists as required (address_detail, contact_detail, responsible_detail).
Steps to Reproduce
Generate a client from the OpenAPI schema document.
Attempt to query the server on various end points, particularly order_so_retrieve (/api/order/so/{id}/)
View that the returned JSON contains notes,
Expected behaviour
I expect the JSON response from the server to comply with the documented schema.
Deployment Method
Docker
Package
Bare metal
Other - added info in Steps to Reproduce
Version Information
My dev server is running master (commit 8bea3ca), client is generated from schema version 309.
Please verify if you can reproduce this bug on the demo site.
I can reproduce this bug on the demo site.
Relevant log output
The text was updated successfully, but these errors were encountered:
I'm currently digging in to the schema generation, but I felt it was worth creating an issue to track against since this is likely to be a series of pull requests instead of a small fix.
Please verify that this bug has NOT been raised before.
Describe the bug*
I can work with pretty much any language I can set up an IDE for, but my language of choice for anything complex is likely to be Java. I've been running SQL queries to pull data directly from my InvenTree database, but that's obviously not ideal.
Given that there's an OpenAPI schema published for InvenTree, I figured it would be straightforward to generate a Java library so I could pull data from my InvenTree instance (particularly
SalesOrder
data). Unfortunately, the schema-generated code doesn't support the response I get back from the server.Running a query for order 1 against the
order_so_retrieve
operation on my dev server with the test data loaded I get the following error (edited to add line breaks for readability):Inspecting the
SalesOrder
schema definition I can verify thatnotes
is not in the schema, but I can also see that some fields are null that the schema lists as required (address_detail
,contact_detail
,responsible_detail
).Steps to Reproduce
/api/order/so/{id}/
)notes
,Expected behaviour
I expect the JSON response from the server to comply with the documented schema.
Deployment Method
Version Information
My dev server is running master (commit 8bea3ca), client is generated from schema version 309.
Please verify if you can reproduce this bug on the demo site.
Relevant log output
The text was updated successfully, but these errors were encountered: