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

Import Error on version update #205

Open
cboschert1 opened this issue Jul 5, 2023 · 3 comments
Open

Import Error on version update #205

cboschert1 opened this issue Jul 5, 2023 · 3 comments

Comments

@cboschert1
Copy link

Expected Behavior

When importing two files, an interface with a component referencing the v1 schema and the v2 interface versioned with additional properties, the models should be imported. I would expect the folder structure to be this after running the command:

versionedRepo
    testmodel.json
    testcomponentmodel.json
localRepo
    testmodel-1.json
    testmodel-2.json
    testcomponentmodel-1.json

Actual Behavior

The dmr-client will see duplicate properties and fail to import the new interface.
Error:

[Error]: dtmi:TestModel:UnchangedProperty;1 has more than one definition. Remove all but one JSON object containing '@id' property with value dtmi:TestModel:UnchangedProperty;1, or change the '@id' values so there are no duplicates.

Steps to Reproduce

Run the command from the attached repository: tests.zip

dmr-client import --directory ./versionedRepo --search-pattern "*.json" --local-repo ./localRepo

@rido-min
Copy link
Member

rido-min commented Jul 6, 2023

versionedRepo/testdevice.json and versionedRepo/testcomponentmodel.json have the same @id what is not permitted in the DMR, each interface must be unique.

if you want to version TestModel, it should have a new version.

@cboschert1
Copy link
Author

Sorry, I attached the wrong files with a copy and paste error. I've attached an updated example with the correct files.
tests.zip

@rido-min
Copy link
Member

rido-min commented Jul 7, 2023

I see, seems there is a conflict when the updated model has an @id in a property. I see two workarounds:

  1. remove the '@id' from the property
  2. import files one by one instead of importing the full folder.

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

No branches or pull requests

2 participants