Implement GET/PUT/DELETE for /shells/asset-information/thumbnail - #618
Open
paul-gerber-svg wants to merge 3 commits into
Open
Implement GET/PUT/DELETE for /shells/asset-information/thumbnail#618paul-gerber-svg wants to merge 3 commits into
GET/PUT/DELETE for /shells/asset-information/thumbnail#618paul-gerber-svg wants to merge 3 commits into
Conversation
Currently, server endpoint `/asset-information/thumbnail`, methods=["GET", "PUT", "DELETE"], endpoint=self.not_implemented is not implemented. According to the AAS Repository Service OpenAPI Specification, the endpoint should return, replace or delete the thumbnail file of a selected AAS. This issue specifies eclipse-basyx#439. This change implements `GET`, `PUT` and `DELETE` for `/shells/{aasIdentifier}/asset-information/thumbnail` according to the specification. `GET` returns the thumbnail file referenced by `AssetInformation.default_thumbnail`. `PUT` accepts a `multipart/form-data` upload (`fileName` and `file`), stores it via the file store, and updates `default_thumbnail` accordingly, removing the previous thumbnail file if the path changes. `DELETE` removes the stored file and clears `default_thumbnail`. All three reject external (non-local) thumbnail references, since the server cannot serve or manage files it does not store itself. Fixes eclipse-basyx#493
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the server endpoint
/asset-information/thumbnailis notimplemented; all three methods (
GET,PUT,DELETE) are mapped toself.not_implemented.According to the AAS Repository Service OpenAPI Specification, the
endpoint should return, replace or delete the thumbnail file of a
selected AAS.
This change implements
GET,PUTandDELETEfor/shells/{aasIdentifier}/asset-information/thumbnailaccording tothe specification.
GETreturns the thumbnail file referenced byAssetInformation.default_thumbnail.PUTaccepts amultipart/form-dataupload (fileNameandfile), stores it viathe file store, and updates
default_thumbnailaccordingly, removingthe previous thumbnail file if the path changes.
DELETEremoves thestored file and clears
default_thumbnail. All three reject external(non-local) thumbnail references, since the server cannot serve or
manage files it does not store itself.
Fixes #493