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(tools): parse OpenAPI to Concerto Metamodel JSON #594

Conversation

stefanblaginov
Copy link
Contributor

@stefanblaginov stefanblaginov commented Jan 20, 2023

Closes #589

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

@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from bdbd25a to 392bd93 Compare January 20, 2023 17:40
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from 392bd93 to 05fec2e Compare January 23, 2023 10:08
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from 05fec2e to 4aba0dc Compare February 1, 2023 18:04
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch 12 times, most recently from 44e073a to 9137f21 Compare February 9, 2023 19:38
@stefanblaginov stefanblaginov marked this pull request as ready for review February 9, 2023 19:40
@stefanblaginov stefanblaginov requested review from a team and dselman February 9, 2023 19:40
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch 2 times, most recently from 21a7f59 to 15267e7 Compare February 17, 2023 18:38
@stefanblaginov stefanblaginov enabled auto-merge (squash) February 17, 2023 18:42
Signed-off-by: Stefan Blaginov <[email protected]>
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch 2 times, most recently from c02d21d to bc6007b Compare February 24, 2023 01:57
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch 2 times, most recently from 77ef757 to 5c2fdc8 Compare March 6, 2023 15:51
Signed-off-by: Stefan Blaginov <[email protected]>
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from 5c2fdc8 to f7b4fd8 Compare March 6, 2023 16:57
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from 2e90955 to 53e00c1 Compare March 6, 2023 17:54
@stefanblaginov stefanblaginov requested a review from mttrbrts March 6, 2023 17:55
@stefanblaginov
Copy link
Contributor Author

Outstanding items addressed and ready for review ✅

const pathToDefinition = this.parseLocalReferenceString(reference.body);
const pathToDefinitions = parameters.pathToDefinitions ||
['definitions'];
const traversedReferences = parameters.traversedReferences ?? [];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const traversedReferences = parameters.traversedReferences ?? [];
parameters.traversedReferences = parameters.traversedReferences ?? [];

Comment on lines +372 to +382
return (
new Definition(definition, pathToDefinition)
).accept(
this, {
...parameters, traversedReferences: [
...traversedReferences,
reference.body
]
}
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return (
new Definition(definition, pathToDefinition)
).accept(
this, {
...parameters, traversedReferences: [
...traversedReferences,
reference.body
]
}
);
}
parameters.traversedReferences.push(reference.body)
return (
new Definition(definition, pathToDefinition)
).accept(
this, parameters
);
}

Comment on lines +130 to +133
assert.equal(
JSON.stringify(inferredConcertoJsonModel, null, 4) + '\n',
desiredConcertoJsonModelString
);
Copy link
Member

Choose a reason for hiding this comment

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

This seems odd to me. Why not just write two assert statements, rather than joining the strings together?

@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch 4 times, most recently from 7c1e749 to 674c4bd Compare March 7, 2023 19:27
@stefanblaginov stefanblaginov requested a review from mttrbrts March 7, 2023 19:30
Signed-off-by: Stefan Blaginov <[email protected]>
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from 674c4bd to b0e6605 Compare March 8, 2023 09:54
Stefan Blaginov and others added 4 commits March 8, 2023 13:37
…hemaVisitor.js


Signed-off-by: Stefan Blaginov <[email protected]>

Co-authored-by: Matt Roberts <[email protected]>
…emaVisitor.js


Signed-off-by: Stefan Blaginov <[email protected]>

Co-authored-by: Matt Roberts <[email protected]>
Signed-off-by: Stefan Blaginov <[email protected]>
@stefanblaginov stefanblaginov force-pushed the stefanblaginov/infer-from-openapi branch from d7e2fd5 to 2d304bd Compare March 8, 2023 14:15
@stefanblaginov stefanblaginov requested a review from mttrbrts March 8, 2023 14:33
@stefanblaginov stefanblaginov merged commit ead9095 into accordproject:main Mar 8, 2023
@stefanblaginov stefanblaginov deleted the stefanblaginov/infer-from-openapi branch March 8, 2023 15:11
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.

OpenAPI/JSON Schema Inference Enhancements
2 participants