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

Namespace Not Defined Error for Imported Files from Online URI #52

Open
kshitij79 opened this issue Aug 16, 2024 · 0 comments
Open

Namespace Not Defined Error for Imported Files from Online URI #52

kshitij79 opened this issue Aug 16, 2024 · 0 comments

Comments

@kshitij79
Copy link
Contributor

kshitij79 commented Aug 16, 2024

Bug Report 🐛

The issue arises when attempting to import types from an online URI within a namespace. The import fails, returning a "Namespace is not defined for type/import" error for all types that are included from the external URI, even when the namespace is properly defined for that type/import in the code for which error is shown.

Expected Behavior

The import statement should correctly recognize the namespace and types defined in the external URI, allowing the file to be processed without errors.
If there is an error in the import, error should correctly identify the wrong import.

Current Behavior

The import process fails, producing an error message stating that the "Namespace is not defined" for the imported type.

Possible Solution

Investigate the handling of namespaces during the validation in concerto-core, especially for files imported from an external URI. Ensure that the namespace definitions from the imported files are properly recognized and integrated into the current file's namespace.

Steps to Reproduce

  1. Define a namespace in a .cto file (e.g., namespace [email protected]).
  2. Import types from an external URI with a different namespace (e.g., import [email protected].{MonetaryAmount} from https://models.accordproject.org/[email protected] , import [email protected].{ContractTemplate} from https://models.accordproject.org/cicero/[email protected]
    See here the second import is wrong, it should be org.accordproject.cicero.dom).
  3. Attempt to use the imported types in the file.
  4. Observe the error message: "Namespace is not defined for type '[email protected]'."
  5. Error message points out the wrong import.

Context (Environment)

Application

  • VSCode (All versions)

Detailed Description

Possible Implementation

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

Successfully merging a pull request may close this issue.

1 participant