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

fix: added top level property entityTypes #95

Merged
merged 22 commits into from
Dec 12, 2024

Conversation

aramovic79
Copy link
Contributor

No description provided.

@aramovic79 aramovic79 linked an issue Nov 14, 2024 that may be closed by this pull request
@aramovic79 aramovic79 self-assigned this Nov 14, 2024
lib/templates.js Outdated Show resolved Hide resolved
Copy link
Contributor

@swennemers swennemers left a comment

Choose a reason for hiding this comment

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

generally looks good, please fix the bug mentioned

@aramovic79 aramovic79 requested a review from swennemers December 4, 2024 11:56
@aramovic79
Copy link
Contributor Author

@zongqichen @swennemers @Fannon : As I've already informed you, if you run the service(in terminal, on path plugins/ORD/xmpl cds run or cds watch), the generated ORD document(http://localhost:4004/open-resource-discovery/v1/documents/1) will have 2 errors when validated in the the API Metadata Validator. This PR should not be merged until we have proper values of level included into the ORD schema.

@aramovic79
Copy link
Contributor Author

@zongqichen @swennemers @Fannon : As I've already informed you, if you run the service(in terminal, on path plugins/ORD/xmpl cds run or cds watch), the generated ORD document(http://localhost:4004/open-resource-discovery/v1/documents/1) will have 2 errors when validated in the the API Metadata Validator. This PR should not be merged until we have proper values of level included into the ORD schema.

This is the reason why I kept this PR to be Draft. Still, @Fannon && @zongqichen , it would be 🚀 if you could review it. Thanks in advance!

@aramovic79 aramovic79 marked this pull request as ready for review December 9, 2024 10:30
@aramovic79 aramovic79 marked this pull request as draft December 9, 2024 10:31
@aramovic79 aramovic79 marked this pull request as ready for review December 9, 2024 14:43
lib/ord.js Show resolved Hide resolved
lib/ord.js Show resolved Hide resolved
lib/templates.js Outdated Show resolved Hide resolved
Comment on lines +127 to +130
if (!SEM_VERSION_REGEX.test(version)) {
Logger.warn(`Entity version "${version}" is not a valid semantic version.`);
}
return version;
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to take care of this logic here, if version is not a valid semantic version, we should not return this invalid version, it will be failed by the validator. Instead, maybe return the default value like 1.0.0. I would expect logger level to error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default version is not an option. Maybe we should throw an exception in case of non-valid version?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, at least we should not provide invalid value. However, I assume this case is really rare in production environment, since we have validator protect us.

Copy link
Contributor Author

@aramovic79 aramovic79 Dec 10, 2024

Choose a reason for hiding this comment

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

If you look at the line above the if (!SEM_VER....)) {, you can see the comment: TODO: version can be stated/overwritten by annotation
Simon told me to keep it that way until we clarify how the version should be set by the model/app-owners.
To his opinion, the right way would be to use an annotation, but he told me to keep it this way for now.
Therefore, I would keep the logger(and not throwing the exception) for now until we have the final statement about the version.

@aramovic79 aramovic79 dismissed swennemers’s stale review December 12, 2024 09:34

All reported findings are addressed.

Copy link
Contributor

@zongqichen zongqichen left a comment

Choose a reason for hiding this comment

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

LGTM

@aramovic79 aramovic79 merged commit 04441d1 into main Dec 12, 2024
3 checks passed
@aramovic79 aramovic79 deleted the fix/69-add-missing-top-level-property-entitytypes branch December 12, 2024 16:28
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.

Fix: top-level property entityTypes is missing
4 participants