Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset/charts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def post(self) -> Response:
return self.response_400(message=error.messages)
try:
new_model = CreateChartCommand(item).run()
return self.response(201, id=new_model.id, result=item)
return self.response(201, id=new_model.id, result=item, uuid=new_model.uuid)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The POST endpoint now includes a top-level uuid in the 201 response, but the OpenAPI docstring for this endpoint still documents only id and result under responses: 201. Please update the response schema docs to include the uuid field so generated API docs match the actual payload.

Copilot uses AI. Check for mistakes.
except DashboardsForbiddenError as ex:
return self.response(ex.status, message=ex.message)
except ChartInvalidError as ex:
Expand Down
2 changes: 1 addition & 1 deletion superset/dashboards/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def post(self) -> Response:
return self.response_400(message=error.messages)
try:
new_model = CreateDashboardCommand(item).run()
return self.response(201, id=new_model.id, result=item)
return self.response(201, id=new_model.id, result=item, uuid=new_model.uuid)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The POST endpoint now returns a top-level uuid in the 201 response, but the OpenAPI docstring for this route still lists only id and result in the 201 schema. Update the documented response properties to include uuid to keep the OpenAPI spec accurate.

Copilot uses AI. Check for mistakes.
except DashboardInvalidError as ex:
return self.response_422(message=ex.normalized_messages())
except DashboardCreateFailedError as ex:
Expand Down
2 changes: 1 addition & 1 deletion superset/datasets/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def post(self) -> Response:

try:
new_model = CreateDatasetCommand(item).run()
return self.response(201, id=new_model.id, result=item, data=new_model.data)
return self.response(201, id=new_model.id, result=item, data=new_model.data, uuid=new_model.uuid)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This POST now includes uuid in the 201 response payload, but the OpenAPI docstring still only documents id and result under responses: 201. Please add uuid to the documented response schema so the generated API docs match behavior.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This self.response(...) call exceeds typical line-length/Black formatting used in the repo. Reformat this call onto multiple lines (with trailing commas) so it stays Black-compliant and avoids CI formatting failures.

Suggested change
return self.response(201, id=new_model.id, result=item, data=new_model.data, uuid=new_model.uuid)
return self.response(
201,
id=new_model.id,
result=item,
data=new_model.data,
uuid=new_model.uuid,
)

Copilot uses AI. Check for mistakes.
except DatasetInvalidError as ex:
return self.response_422(message=ex.normalized_messages())
except DatasetCreateFailedError as ex:
Expand Down
3 changes: 3 additions & 0 deletions tests/integration_tests/charts/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@ def test_create_chart(self):
assert rv.status_code == 201
data = json.loads(rv.data.decode("utf-8"))
model = db.session.query(Slice).get(data.get("id"))
# uuid should be returned in the response
assert "uuid" in data
assert str(model.uuid) == str(data["uuid"])
db.session.delete(model)
db.session.commit()

Expand Down
3 changes: 3 additions & 0 deletions tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,6 +1591,9 @@ def test_create_dashboard(self):
assert rv.status_code == 201
data = json.loads(rv.data.decode("utf-8"))
model = db.session.query(Dashboard).get(data.get("id"))
# uuid should be returned in the response
assert "uuid" in data
assert str(model.uuid) == str(data["uuid"])
db.session.delete(model)
db.session.commit()

Expand Down
3 changes: 3 additions & 0 deletions tests/integration_tests/datasets/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,9 @@ def test_create_dataset_item(self):
assert model.database_id == table_data["database"]
# normalize_columns should default to False
assert model.normalize_columns is False
# uuid should be returned in the response
assert "uuid" in data
assert str(model.uuid) == str(data["uuid"])

# Assert that columns were created
columns = (
Expand Down
Loading