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 generation of JSON sample payload #674

Merged

Conversation

atextor
Copy link
Contributor

@atextor atextor commented Nov 7, 2024

Description

JSON sample payload generation sometimes includes a @type attribute that is
intentionally added to enable Jackson parsing JSON when Entity inheritance is
used. However, this is not valid according to the specification. This PR
therefore makes adding @type configurable with "off" being the default; in
addition it is possible to control the JsonTypeInfo annotation that is
inserted in generated Java classes; with the default now changed from NAME to
DEDUCTED (which works without @type in many cases), but it is changeable (in
Java API/Maven Plugin/samm-cli).

Fixes #669

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

I.e., have it inherit from Generator and use the same configuration approach as
the other generators
org.eclipse.esmf.aspectmodel.generator.Generator already fulfills this task
Copy link
Contributor

@Yauhenikapl Yauhenikapl left a comment

Choose a reason for hiding this comment

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

LGTM!

@atextor atextor merged commit a7cf8f2 into eclipse-esmf:main Nov 8, 2024
4 checks passed
@atextor atextor deleted the 669-invalid-attribute-in-sample-json-payload branch November 8, 2024 15:37
Copy link

Release v2.9.8 addresses this.

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.

[BUG]"@type" in json sample output
2 participants