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

feat(*): use modelfile to getType() #742

Merged
merged 5 commits into from
Nov 7, 2023

Conversation

jonathan-casey
Copy link
Member

@jonathan-casey jonathan-casey commented Oct 20, 2023

Description

Gets the type from the ModelFile, removes the utility function.

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

@jonathan-casey jonathan-casey requested a review from a team October 20, 2023 15:00
@jonathan-casey jonathan-casey changed the title feat(*): use modelfile get type feat(*): use modelfile to getType() Oct 20, 2023
@@ -69,7 +69,8 @@ class MapValueType extends Decorated {
*/
validate() {
if (!ModelUtil.isPrimitiveType(this.type)) {
const decl = ModelUtil.getTypeDeclaration(this.ast.type.name, this.modelFile);

const decl = this.modelFile.getType(this.ast.type.name);

// All declarations, with the exception of MapDeclarations, are valid Values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we got a test for enums and scalars as values?

Copy link
Member Author

@jonathan-casey jonathan-casey Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Map Key yes. Coverage for imported Scalars as Values I've just added for completeness (the same function is under test).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't support Enums as Map types (yet).

Copy link
Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this...

@jonathan-casey jonathan-casey force-pushed the jonathan/use_modelfile_get_type branch from 81fe1cc to d3b2d52 Compare October 20, 2023 22:54
@jonathan-casey jonathan-casey merged commit f57148f into main Nov 7, 2023
11 checks passed
@jonathan-casey jonathan-casey deleted the jonathan/use_modelfile_get_type branch November 7, 2023 12:45
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 this pull request may close these issues.

2 participants