Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Models imported with a URL do not get loaded #106

Open
jeromesimeon opened this issue Apr 15, 2019 · 7 comments
Open

Models imported with a URL do not get loaded #106

jeromesimeon opened this issue Apr 15, 2019 · 7 comments
Labels

Comments

@jeromesimeon
Copy link
Member

When updating a model file with a new import with a from URL the model manager does not load the model.

E.g.,

Starting from the hello world template, and adding this line:

import org.accordproject.address.PostalAddress from https://models.accordproject.org/address.cto

Does not provide access too the address type.

@jeromesimeon jeromesimeon added the Type: Bug 🐛 Something isn't working label Apr 15, 2019
@dselman
Copy link
Contributor

dselman commented Apr 15, 2019

Just found this one as well. We need to call: https://github.com/hyperledger/composer-concerto/blob/master/lib/modelmanager.js#L310

Ideally we would only call this if the list of external imports had changed for the model file:
https://github.com/hyperledger/composer-concerto/blob/master/lib/introspect/modelfile.js#L180

As it is quite costly (downloads external imports and then validates all model files).

@jolanglinais jolanglinais removed the Hacktoberfest by DigitalOcean and DEV label Sep 27, 2019
@norweis
Copy link

norweis commented Jul 15, 2021

I also found that most model imports do not work properly. I needed to copy the contents of the URL into the model.

@jeromesimeon
Copy link
Member Author

I also found that most model imports do not work properly. I needed to copy the contents of the URL into the model.

Could you be more specific and provide an example, please?

@norweis
Copy link

norweis commented Jul 15, 2021

Okay, already 3 people posted examples for this long time error in #152, #177, and this one.

Here is a forth example for a model.cto file:
import org.accordproject.address.PostalAddress from https://models.accordproject.org/address.cto

It reports:
[Change Model] Namespace is not defined for type org.accordproject.address.PostalAddress File 'model/model.cto'

The URL is valid, since one can download the address.cto.
If you try other imports from the model lib https://models.accordproject.org/, most of them fail.

@jeromesimeon
Copy link
Member Author

jeromesimeon commented Jul 15, 2021

Okay, already 3 people posted examples for this long time error in #152, #177, and this one.

Here is a forth example for a model.cto file:
import org.accordproject.address.PostalAddress from https://models.accordproject.org/address.cto

It reports:
[Change Model] Namespace is not defined for type org.accordproject.address.PostalAddress File 'model/model.cto'

The URL is valid, since one can download the address.cto.
If you try other imports from the model lib https://models.accordproject.org/, most of them fail.

I'm trying to understand if your report is a new issue, or an existing one. This is the same issue as previously recorded, correct?

@norweis
Copy link

norweis commented Jul 15, 2021

It seems to be the same issue as this one and its possible duplicates in #152, #177, so I did not open a forth issue for this error.

@jeromesimeon
Copy link
Member Author

It seems to be the same issue as this one and its possible duplicates in #152, #177, so I did not open a forth issue for this error.

@norweis Just FYI: development / maintenance of template studio has been on hold for a while. For more active development we recommend the VSCode plugin which is more robust.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants