Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot update non-string properties via REST API #235

Open
iosb-ina-mr opened this issue Apr 11, 2024 · 4 comments · May be fixed by #238
Open

[Bug]: Cannot update non-string properties via REST API #235

iosb-ina-mr opened this issue Apr 11, 2024 · 4 comments · May be fixed by #238
Labels
bug Something isn't working

Comments

@iosb-ina-mr
Copy link

iosb-ina-mr commented Apr 11, 2024

Contact Details

marc.riedlinger@iosb-ina.fraunhofer.de

Describe the bug

Non-string properties of submodels cannot be updated via the following Patch call:
/shells/{aasIdentifier}/submodels/{submodelIdentifier}/submodel-elements/{idShortPath}/$value
The value type of the affected property changes to string but the value does not change.

To reproduce

Create a submodel with any property that is not a string (double, int, etc..) and try to update it with the Swagger UI.

Screenshots

No response

Expected Behaviour

Any property should update if the passed value is of the same type. Otherwise, an error should be returned. Furthermore, the value type should not change.

Version

Commit: 2c90a7a

Operating System

Linux

Relevant log output

No response

@iosb-ina-mr iosb-ina-mr added the bug Something isn't working label Apr 11, 2024
@iosb-ina-mr iosb-ina-mr changed the title [Bug]: Cannot update non-string properties via swagger API [Bug]: Cannot update non-string properties via REST API Apr 11, 2024
@Freezor
Copy link
Contributor

Freezor commented Apr 12, 2024

Will take over and look into this issue

@Freezor
Copy link
Contributor

Freezor commented Apr 15, 2024

As far as I can see, we will always go to RequestValueMapper.cs:

private static IClass Transform(PropertyValue valueDTO)
{
    return new Property(DataTypeDefXsd.String, idShort: valueDTO.idShort, value: valueDTO.value);
}

Apparently, we use the Property class from the generated code, which seems to have only a string value. This might also be related to the issue mentioned in #236. However, I can't determine if this behavior is intended or expected. There are no unit tests to verify whether this is the desired behavior. Maybe @juileetikekar or @aorzelskiGH can provide insights or assistance here.

@Freezor Freezor linked a pull request Apr 16, 2024 that will close this issue
8 tasks
@Freezor
Copy link
Contributor

Freezor commented Apr 16, 2024

@iosb-ina-mr as far as I can see it, the change itself runs trough correctly. What I do not understand yet is that I can change the name of the ID as well... But it currently looks like that the issue is not on the side of the change itself but starts much earlies when the AAS file is loaded

@iosb-ina-mr
Copy link
Author

@iosb-ina-mr as far as I can see it, the change itself runs trough correctly. What I do not understand yet is that I can change the name of the ID as well... But it currently looks like that the issue is not on the side of the change itself but starts much earlies when the AAS file is loaded

@Freezor thank you for sharing your findings. That is indeed a strange behavior because the AAS is correctly displayed in the Blazor UI after having been loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants