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: adding interpreter options ignoreAddtionalProperties and ignoreAddtionalItems #1094

Merged
merged 4 commits into from
Jan 25, 2023

Conversation

artur-ciocanu
Copy link
Collaborator

Description
This is an enhancement that would allow anyone to override default interpreter behavior for additionalProperties, and additionalItems.

A typical example using these interpreter options would look like this:

const generator = new JavaGenerator({
  processorOptions: {
    interpreter: {
      ignoreAdditionalProperties: true,
      ignoreAdditionalItems: true  
    }
  }
});

**Related issue(s)**
https://github.com/asyncapi/modelina/issues/916

@artur-ciocanu
Copy link
Collaborator Author

@200Puls feel free to check this feature. I hope it will land soon in a stable release. For now we decide to start small and allow changing the behavior of additionalProperties and additionalItems via interpreter options.

@artur-ciocanu
Copy link
Collaborator Author

@jonaslagoni please take a look when you have a chance. Thank you! 🙇

@coveralls
Copy link

coveralls commented Jan 23, 2023

Pull Request Test Coverage Report for Build 4006812059

  • 2 of 4 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.05%) to 92.338%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/interpreter/InterpretAdditionalItems.ts 1 2 50.0%
src/interpreter/InterpretAdditionalProperties.ts 1 2 50.0%
Totals Coverage Status
Change from base Build 4000693541: -0.05%
Covered Lines: 4727
Relevant Lines: 4988

💛 - Coveralls

@200Puls
Copy link
Contributor

200Puls commented Jan 23, 2023

Hi @artur-ciocanu Thanks for the notification.

This matches my use case too. I want to disable both of these.

We have started using the build from the next branch for some other features.

Will this be merged into both?

@artur-ciocanu
Copy link
Collaborator Author

Hi @artur-ciocanu Thanks for the notification.

This matches my use case too. I want to disable both of these.

We have started using the build from the next branch for some other features.

Will this be merged into both?

The next branch has been merged to master. I believe @jonaslagoni plans to release Modelina v1 either today or this week.

@200Puls
Copy link
Contributor

200Puls commented Jan 23, 2023

The next branch has been merged to master. I believe @jonaslagoni plans to release Modelina v1 either today or this week.

Ah cool I totally missed that.

@artur-ciocanu
Copy link
Collaborator Author

@jonaslagoni thanks for merging master. When you have a chance could please take a look. Thank you.

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Just a few comments, otherwise it looks good 👍

src/interpreter/InterpretAdditionalProperties.ts Outdated Show resolved Hide resolved
src/interpreter/InterpretAdditionalItems.ts Outdated Show resolved Hide resolved
examples/overwrite-interpreter-options/package.json Outdated Show resolved Hide resolved
@artur-ciocanu
Copy link
Collaborator Author

@jonaslagoni I have addressed your comments, let me know if it looks good.

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Just some doc changes 🙂

examples/passing-interpreter-options/README.md Outdated Show resolved Hide resolved
examples/passing-interpreter-options/README.md Outdated Show resolved Hide resolved
Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jonaslagoni
Copy link
Member

/rtm

@sonarcloud
Copy link

sonarcloud bot commented Jan 25, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@asyncapi-bot asyncapi-bot merged commit 3745f54 into asyncapi:master Jan 25, 2023
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@artur-ciocanu artur-ciocanu deleted the interpreter-override branch January 25, 2023 15:04
@artur-ciocanu
Copy link
Collaborator Author

@200Puls it is finally out, please check it out!

@200Puls
Copy link
Contributor

200Puls commented Jan 27, 2023

@200Puls it is finally out, please check it out!

Hi @artur-ciocanu works for me. Thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants