-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
The Or paste ODCS JSON path in the Upload File modal does not import valid JSON contracts.
After pasting valid JSON and clicking the modal background, the UI shows Failed to import ODCS JSON. The frontend sends POST /api/data-contracts/odcs/import, and the backend responds 405 Method Not Allowed.
I verified this with:
- a minimal JSON contract without
support - a minimal JSON contract with
support
Both return 405, so this issue appears independent of the separate support-field file upload bug (#73).
Also, there's no obvious trigger for submitting the JSON input. I clicked the modal background and that seems to trigger a request to the backend, but there really should be a button or something.
Expected Behavior
Pasting valid ODCS JSON into the upload modal should import the contract successfully.
Steps To Reproduce
- Open Ontos and go to
Data Contracts. - Click
Upload File. - Paste this JSON into
Or paste ODCS JSON:
{
"kind": "DataContract",
"apiVersion": "v3.1.0",
"id": "urn:datacontract:example:public:upload:control-json",
"name": "public_upload_control_json",
"version": "1.0.0",
"status": "draft",
"description": {
"purpose": "Minimal public JSON control contract without support entries."
}
}- Click the modal background.
- Observe that the UI shows
Failed to import ODCS JSON. - Observe that
POST /api/data-contracts/odcs/importreturns405 Method Not Allowed.
Comparison: - Repeat with this JSON containing
support:
{
"kind": "DataContract",
"apiVersion": "v3.1.0",
"id": "urn:datacontract:example:public:upload:repro-json",
"name": "public_support_upload_repro_json",
"version": "1.0.0",
"status": "draft",
"description": {
"purpose": "Minimal public JSON repro for Ontos contract upload failure."
},
"support": [
{
"channel": "#support-example",
"tool": "slack",
"scope": "technical",
"url": "https://example.com/support-example"
}
]
}- Observe that it also returns
405 Method Not Allowed.
Cloud
AWS
Browser
Chrome
Version
latest
Relevant log output
Failing JSON import request from the modal
- Endpoint: POST /api/data-contracts/odcs/import
- Status: 405
- Request ID: 66487843-c866-4760-bd15-cd8df232a3af
- Response body: {"detail":"Method Not Allowed"}
Equivalent fetch test with minimal JSON contract without support
- Endpoint: POST /api/data-contracts/odcs/import
- Status: 405
- Response body: {"detail":"Method Not Allowed"}
Equivalent fetch test with minimal JSON contract with support
- Endpoint: POST /api/data-contracts/odcs/import
- Status: 405
- Response body: {"detail":"Method Not Allowed"}
Frontend console
Failed to load resource: the server responded with a status of 405 ()Reactions are currently unavailable