Skip to content

Fix response payload type for PutSubmodelById (3.2 Port)#602

Open
aaronzi wants to merge 5 commits into
admin-shell-io:IDTA-01002-3-2_workingfrom
aaronzi:IDTA-01002-3-2_working
Open

Fix response payload type for PutSubmodelById (3.2 Port)#602
aaronzi wants to merge 5 commits into
admin-shell-io:IDTA-01002-3-2_workingfrom
aaronzi:IDTA-01002-3-2_working

Conversation

@aaronzi
Copy link
Copy Markdown
Member

@aaronzi aaronzi commented May 5, 2026

This pull request fixes the response payload type for the PutSubmodelById operation in the Asset Administration Shell Repository OpenAPI specification. Specifically, when a submodel is created (status code 201), the response now correctly returns a Submodel object instead of a Reference. The changelog has also been updated to reflect this fix.

API Specification Fixes:

  • The description for the 201 response in AssetAdministrationShellRepositoryServiceSpecification/V3.2_SSP-001.yaml was updated to clarify that a submodel is created, not a reference.
  • The response schema for status code 201 now returns a Submodel instead of a Reference for the PutSubmodelById operation.

Documentation Updates:

  • The changelog (changelog.adoc) now documents this fix under minor changes, referencing the related issue.

Related Issues

See #601

Cherry picked ec5b1d1 from #615

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 5, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Collaborator

@mjacoby mjacoby left a comment

Choose a reason for hiding this comment

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

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.

@aaronzi
Copy link
Copy Markdown
Member Author

aaronzi commented May 6, 2026

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.

@sebbader-sap
Copy link
Copy Markdown
Contributor

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.

@mjacoby this is more like a general remark on the PUT endpoint design, not affecting this bugfix, right?

@BirgitBoss BirgitBoss added this to the 3.1.3 milestone May 11, 2026
@mjacoby
Copy link
Copy Markdown
Collaborator

mjacoby commented May 12, 2026

I understand that fixing the return type (from Reference to Submodel) and the whole upsert a two separate things. However, your commit not only contains the fix of the return type but also introduces upsert behavior in the file Entire-API-Collection/V3.2.yaml. This is the only reason I brought up the upsert topic here - because I did not expect a fix to introduce new functionality.

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 201 in V3.2_SSP-001.yaml and V3.2_SSP-005.yaml which is not what PR actually contains (only a change to Entire-API-Collection/V3.2.yaml).

I am therefore confused about the PR, its intention and scope and if the code matches the description of the PR's content.

@aaronzi
Copy link
Copy Markdown
Member Author

aaronzi commented May 12, 2026

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 API-Collection/V3.2.yaml, I thought that document should always be aligned to the individual services openapi files. I found this inconsistency there that the 201 response was missing entirely. I added it there as well. If that file should not be maintained alongside the individual services, I can of course remove that change again @mjacoby.

@aaronzi aaronzi changed the title Fixes PUT submodel superpath return type on 201 status Fix response payload type for PutSubmodelById (3.2 Port) May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Submodel Create via PUT /shells/{aasIdentifier}/submodels/{submodelIdentifier} return wrong type on 201

5 participants