Fix response payload type for PutSubmodelById (3.2 Port)#602
Conversation
…rn type on 201 status
mjacoby
left a comment
There was a problem hiding this comment.
The default behavior of PUT request in the AAS is updating existing elements and returning 204 No Content without any payload.
The only times this pattern is broken for PUT /shells/{aasIdentifier} and PUT /submodels/{submodelIdentifier}. In these cases the description says "Creates or updates existing ..." and the method returns either 201 is a new element has been created or 204 if an existing element has been updated.
Your proposal does not match any of the two existing patterns.
|
I agree with all you sentences @mjacoby except the last one. I did not change anything when it comes to when which status is returned. I just fixed the return type in the case of a 201 status. |
@mjacoby this is more like a general remark on the PUT endpoint design, not affecting this bugfix, right? |
|
I understand that fixing the return type (from I am fine with the part of the PR fixing the return type, but the whole upsert thing is more complex than this. I also noticed that the PR description mentions that you changed the response code to I am therefore confused about the PR, its intention and scope and if the code matches the description of the PR's content. |
|
Ah, now I get your remark. The description was copilot generated. I guess I have missed this in my review of that text. Regarding the change in the |
This pull request fixes the response payload type for the
PutSubmodelByIdoperation in the Asset Administration Shell Repository OpenAPI specification. Specifically, when a submodel is created (status code 201), the response now correctly returns aSubmodelobject instead of aReference. The changelog has also been updated to reflect this fix.API Specification Fixes:
AssetAdministrationShellRepositoryServiceSpecification/V3.2_SSP-001.yamlwas updated to clarify that a submodel is created, not a reference.Submodelinstead of aReferencefor thePutSubmodelByIdoperation.Documentation Updates:
changelog.adoc) now documents this fix under minor changes, referencing the related issue.Related Issues
See #601
Cherry picked ec5b1d1 from #615