admin-shell-io / aas-specs-api

Repository of the Asset Administration Shell Specification DTA-01002 API
https://admin-shell-io.github.io/aas-specs-antora/index/home/index.html
Creative Commons Attribution 4.0 International
12 stars 4 forks source link

Inconsistent OpenAPI specification for PutFileByPath #170

Open mhrimaz opened 1 year ago

mhrimaz commented 1 year ago

The OpenAPI the specification mentions two parameter as form-data.

MicrosoftTeams-image (7)

But in API specificaiton there is only a binary file payload.

MicrosoftTeams-image (8)

MicrosoftTeams-image (9)

So as an example in Postman, which type of request is valid?

image

Could you clarify on that?

sebbader-sap commented 1 year ago

The second one with the "form-data" option (adding implicitly the http header "multipart/form-data" to the request) is the right one. Please note that chapter 5 and all other ones before chapter 12 are protocol-independent and therefore not the normative context for HTTP calls.

mjacoby commented 1 year ago

This means that the HTTP PUT contains both the filename and file content in the body, correct? If yes, what is the expected behavior regarding the file name?

Image the following example...

Given the model

AAS -> Submodel (id=submodel1) -> File (idShort=file1) and the File.value is foo.pdf.

Now the following request is executed PUT submodels/c3VibW9kZWwx/submodel/submodel-elements/file1/attachment with body

What is the expected behavior?

  1. The call is rejected as invalid because the file name present the File object (foo.pdf) and the one provided in the request (bar.pdf) do not match?
  2. Is the file name in the File object updated to the one provided in the request, i.e. File.value = bar.pdf after processing the request?
  3. Is the filename in the request simply ignored and the file content is just written to the file given by File.value i.e. foo.pdf?
  4. Something else not listed here
BirgitBoss commented 10 months ago

Are the "File" API operation dealing with submodel elements "Blob" or "File" or both? Please make this clearer in textual documentation. This is a constraint that the idPath needs to reference to a Blob

sebbader-sap commented 9 months ago

@aorzelskiGH can you have a look?