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: remaining test and implementation issues #824

Merged
merged 29 commits into from
Jul 28, 2022

Conversation

jonaslagoni
Copy link
Member

@jonaslagoni jonaslagoni commented Jul 28, 2022

Description
This PR fixes all remaining tests and implementations to finally go back to tests working for further development.

This is one big PR, because @magicmatatjahu prefers it until everything is back to being checked by CI, which I think makes sense.

Changes this PR introduces:

  • Based on the new constraint functionality the old AsyncAPI <anonymous-schema-x> ids for schemas do not make any sense as they will be converted to LessAnonymousSchemaXGreater which is unintended. (afd1a16)
  • Fixed CommonModel.spec.ts where pattern properties and additional items are no longer part of CommonModel (9371511)
  • Fixed examples/change-type-mapping test and implementation (5ce0540)
  • Fixed examples/adapting-input-and-output test and implementation (23e1726)
  • Updated browserslist through npx browserslist@latest --update-db (5532439)
  • Fixed examples/csharp-overwrite-enum-naming test and implementation (8bcd5c7)
  • Fixed examples/csharp-use-inheritance implementation (9dbcd9c)
  • Fixed examples/meta-model test and implementation (3f92396)
  • Fixed examples/overwrite-default-constraint test and implementation (dcc8417)
  • Update snapshots for examples/generate-to-files (e2afcdc)
  • Fixed examples/typescript-enum-type test and implementation (c17b77c)
  • Fixed nested options were not being merged together with default options, this made it so if you wanted to overwrite constraint or type behavior, you HAD to implement functions instead of only part of it which was the intention (27ab4dc, 384f68c)
  • Fixed that some reserved keywords were never caught because of lowercase/uppercase differences (0d27a14)
  • Fixed recursive models did not get handled properly by the splitter, constrainer, and CommonModel to MetaModel conversion (216ee92)
  • Fixed interpreter tests (781a57a)
  • Fixed default presets never receive the options from the generator (319be16)
  • Fixed C# properties cannot have the same name as their enclosing model (82930c2)
  • Simplified the marshaling preset for TS and JS as I do not want runtime tests within the presets that tests the generated code beyond what it should generate. This will be the job of the BlackBox test that will run all these runtime tests (17149e9)
  • Fixed Java enums not generating accurate value types, defaulting to Object to support all cases (ff3f5d4)
  • Fixed TS generator not generating union enums (39b45af)
  • Extend some PropertyKeyConstrainer assertions (41e88ab)
  • Export and test custom constraint logic (04ba228)
  • Fixed BlackBox testing and added minimal test cases for starters. In the coming weeks, I will slowly enable them and fix the issues they bring up (43a90fe)
  • Fixed marshaling presets not using unconstrained property names (7193a80)
  • Fixed remaining build and lint errors (ad786c6, 742b791, aca8186)

…constrainer and CommonModel to MetaModel conversion
…ime tests within the presets that tests the generated code beyond what it should generate. This will be the job of the blackbox test that will run all these runtime tests.
@jonaslagoni
Copy link
Member Author

@Samridhi-98 @ron-debajyoti I am not expecting you to review these changes, although feel free to do so, especially those changes for your areas, but entirely up to you 🙂

@jonaslagoni jonaslagoni changed the title chore: fix remaining test and implementation issues fix: remaining test and implementation issues Jul 28, 2022
@jonaslagoni
Copy link
Member Author

#774 will handle doc changes, so I am not gonna fix the failing Check Markdown links.

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

Very good! I only have two comments.

src/utils/Partials.ts Outdated Show resolved Hide resolved
test/blackbox/blackbox.spec.ts Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jul 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

@jonaslagoni jonaslagoni merged commit 9f8ab72 into asyncapi:next Jul 28, 2022
@jonaslagoni jonaslagoni deleted the feature/fix_remaining_tests branch July 28, 2022 12:13
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.39.9-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

jonaslagoni added a commit that referenced this pull request Jan 23, 2023
## [1.0.0](v0.59.9...v1.0.0) (2023-01-23)

### Upgrade Steps

You can find the migration details here: https:/asyncapi/modelina/blob/master/docs/migration.md 

Dont hesitate to reach out if you need help migrating to version 1.

### Breaking Changes
There is no specific PR that contains the breaking changes but is part of multiple PRs. See the migration part above.

### New Features
* feat: add Rust Generator (#818)
* feat: add Kotlin model generator (#1074)
* feat: add Python generator (#863)
* feat: add jsonbinpack preset for TypeScript (#854)
* feat: add support for AsyncAPI 2.5 (#893)
* feat: add support for oneOf and anyOf as UnionModel (#899)
* feat: integrate new AsyncAPI parser version (#925)
* feat: add C# Newtonsoft preset (#970)
* feat: add access to entire property object in constrainer (#985)
* feat: add precise csharp enum type (#1047)
* feat: add dependency manager (#1063)

### Bug Fixes
* fix: unwrapping dictionaries not working in marshaling preset (#855)
* fix: import path of helpers in DartRenderer (#794)
* fix: modelina cannot be used in website environments (#843)
* fix: duplicate dependencies being rendered (#842)
* fix: inner references not being found (#844)
* fix: root level references are not handled for JSON Schema (#829)
* fix: wrong typescript number type used for integers (#902)
* fix: merging CommonModel properties should not carry over properties to other models (#917)
* fix: duplicate and self dependencies should not be rendered (#903)
* fix: python generates unusable class for empty properties (#901)
* fix: javascript should not split out enums (#926)
* fix: typescript marshaling preset not caring about external models (#927)
* fix: typescript rendering wrong array type when union (#928)
* fix: java dictionary constrainer gives unusable integer type for map value (#929)
* fix: remove unintended characters for typescript marshaling preset (#935)
* fix: enable processor options to be passed processors (#920)
* fix: references are getting incorrect model names (#951)
* fix: enum generator for Java should use strict types for it's values (#944)
* fix: implicit python import error (#981)
* fix: rust compile errors on enum members containing digits (#994)
* fix: add `exec` as a reserved keyword for Python (#1000)
* fix: c# newtonsoft preset syntax errors (#1004)
* fix: rust enum renderer only working for JSON Schema inputs (#1001)
* fix: dependencies are rendered twice (#1002)
* fix: rust impl new fn for Boxed values (#1013)
* fix: solving blackbox tests problems (#905)
* fix: structs missing pub keyword in RustGenerator (#1021)
* fix: reserved keywords in Rust should be case-sensitive (#1031)
* fix: pattern properties not being accounted for (#1006)
* fix: csharp generator does not render optional types for optional properties (#1051)
* fix: polymorphic / union models rendered with index in enum member name (#1056)
* fix: add Jackson annotations at the field level (#1059)
* fix: improve integration with old AsyncAPI parser (#1050)
* fix: add Java constraints annotations at the field level (#1067)
* fix: java generator could generate illegal package names (#1084)

### Other Changes
* docs: new core data model (#530)
* refactor: introduce new core models (#655)
* refactor: add CommonModel conversion to MetaModel (#677)
* refactor: add TypeScript constrainer (#683)
* refactor: add JavaScript constrainer (#693)
* refactor: add Go constrainer (#695)
* refactor: add splitter (#676)
* refactor: add C# constrainer (#696)
* refactor: add Java constrainer (#694)
* refactor: simplified constraints and type mapping (#725)
* refactor: convert CSharp to new constraint setup (#735)
* refactor: convert Go to new constraint setup (#732)
* refactor: convert TS to new constraint setup (#736)
* refactor: convert JS to new constraint setup (#741)
* refactor: add object property model (#758)
* chore: refactored model setup to support generators (#766)
* chore: refactored input processors (#767)
* chore: refactored TypeScript and generator implementation (#765)
* chore: refactored Java to new core model (#769)
* chore: refactored Go generator (#771)
* chore: refactored CSharp generator (#770)
* chore: refactored JavaScript generator  (#773)
* chore: refactored dart generator (#778)
* chore: fix build errors (#779)
* chore: fix file generator tests (#782)
* chore: add test and fix constrain implementation (#781)
* chore: fix wrongful import (#783)
* refactor: switch interpretation of pattern properties (#791)
* refactor: fix constrain helpers and add test (#792)
* chore: convert to any model from common model (#793)
* chore: remove old post interpreter and fix tests (#795)
* chore: fix TypeHelpers tests (#802)
* chore: fix generator and renderer tests (#803)
* chore: remove unnecessary common model test (#798)
* chore: remove name helpers (#801)
* chore: fix tests for OutputModel (#800)
* chore: give constrained properties access to the raw property (#799)
* chore: fix enum model conversion (#797)
* chore: fix contains property check failing (#810)
* chore: removed unused property and fix general tests (#809)
* chore: refactor dart generators and test (#796)
* chore: rewrite java generator tests (#804)
* chore: rewrite TypeScript generator tests (#806)
* chore: rewrite CSharp generator tests (#807)
* chore: rewrite javascript generator tests (#805)
* fix: remaining test and implementation issues (#824)
* docs: move banner location (#865)
* docs: update language documentation (#862)
* docs: add migration guidelines (#860)
* docs: update input processing documentation (#859)
* docs: update constraint documentation (#858)
* chore: remove unused functions (#849)
* docs: update usage documentation (#857)
* docs: update preset documentation (#861)
* refactor: simplified example tests (#868)
* chore: add a template for new generators (#850)
* docs: remove duplicate dart output (#892)
* test: update snapshot for failing test (#907)
* chore: add a new example for json-schema-draft4-from-object (#897)
* chore: add a new example for JSON schema draft 6 (#933)
* ci: use @swc/jest to speedup tests (#938)
* ci: fix broken release pipeline (#956)
* docs: add contribution guidelines for processors (#950)
* chore: add missing test dependency for docker (#992)
* docs: add contributing guidelines for presets (#990)
* docs: improve readme with use-cases and examples (#1034)
* chore: add missing blackbox scripts (#1046)
* docs: add versioning and maintenance section (#991)
* test: update snapshots (#1064)
* docs: fix the wrong link to constraint example (#1065)
* test: added example to generate all models within the same file (#1054)
* chore: added prettier config (#838)
* chore: format code (#1088)


Co-authored-by: Kenneth Aasan <[email protected]>, Co-authored-by: Leigh Johnson <[email protected]>, Co-authored-by: Maciej Urbańczyk <[email protected]>, Co-authored-by: Nitin Tejuja <[email protected]>, Co-authored-by: Amit Kumar Sharma <[email protected]>, Co-authored-by: artur-ciocanu <[email protected]>, Co-authored-by: Andrey Zaytsev <[email protected]>, Co-authored-by: Zbigniew Malcherczyk <[email protected]>, Co-authored-by: Yushi OMOTE <[email protected]>, Co-authored-by: Alejandra Quetzalli  <[email protected]>, Co-authored-by: Artur Ciocanu <[email protected]>, Co-authored-by: Julian R <[email protected]>, Co-authored-by: Anay Sarkar <[email protected]>, Co-authored-by: Louis Xhaferi <[email protected]>, Co-authored-by: Akshat Nema <[email protected]>
jonaslagoni added a commit that referenced this pull request Jan 24, 2023
## [1.0.0](v0.59.9...v1.0.0) (2023-01-23)

### Upgrade Steps

You can find the migration details here: https:/asyncapi/modelina/blob/master/docs/migration.md 

Dont hesitate to reach out if you need help migrating to version 1.

### Breaking Changes
There is no specific PR that contains the breaking changes but is part of multiple PRs. See the migration part above.

### New Features
* feat: add Rust Generator (#818)
* feat: add Kotlin model generator (#1074)
* feat: add Python generator (#863)
* feat: add jsonbinpack preset for TypeScript (#854)
* feat: add support for AsyncAPI 2.5 (#893)
* feat: add support for oneOf and anyOf as UnionModel (#899)
* feat: integrate new AsyncAPI parser version (#925)
* feat: add C# Newtonsoft preset (#970)
* feat: add access to entire property object in constrainer (#985)
* feat: add precise csharp enum type (#1047)
* feat: add dependency manager (#1063)

### Bug Fixes
* fix: unwrapping dictionaries not working in marshaling preset (#855)
* fix: import path of helpers in DartRenderer (#794)
* fix: modelina cannot be used in website environments (#843)
* fix: duplicate dependencies being rendered (#842)
* fix: inner references not being found (#844)
* fix: root level references are not handled for JSON Schema (#829)
* fix: wrong typescript number type used for integers (#902)
* fix: merging CommonModel properties should not carry over properties to other models (#917)
* fix: duplicate and self dependencies should not be rendered (#903)
* fix: python generates unusable class for empty properties (#901)
* fix: javascript should not split out enums (#926)
* fix: typescript marshaling preset not caring about external models (#927)
* fix: typescript rendering wrong array type when union (#928)
* fix: java dictionary constrainer gives unusable integer type for map value (#929)
* fix: remove unintended characters for typescript marshaling preset (#935)
* fix: enable processor options to be passed processors (#920)
* fix: references are getting incorrect model names (#951)
* fix: enum generator for Java should use strict types for it's values (#944)
* fix: implicit python import error (#981)
* fix: rust compile errors on enum members containing digits (#994)
* fix: add `exec` as a reserved keyword for Python (#1000)
* fix: c# newtonsoft preset syntax errors (#1004)
* fix: rust enum renderer only working for JSON Schema inputs (#1001)
* fix: dependencies are rendered twice (#1002)
* fix: rust impl new fn for Boxed values (#1013)
* fix: solving blackbox tests problems (#905)
* fix: structs missing pub keyword in RustGenerator (#1021)
* fix: reserved keywords in Rust should be case-sensitive (#1031)
* fix: pattern properties not being accounted for (#1006)
* fix: csharp generator does not render optional types for optional properties (#1051)
* fix: polymorphic / union models rendered with index in enum member name (#1056)
* fix: add Jackson annotations at the field level (#1059)
* fix: improve integration with old AsyncAPI parser (#1050)
* fix: add Java constraints annotations at the field level (#1067)
* fix: java generator could generate illegal package names (#1084)

### Other Changes
* docs: new core data model (#530)
* refactor: introduce new core models (#655)
* refactor: add CommonModel conversion to MetaModel (#677)
* refactor: add TypeScript constrainer (#683)
* refactor: add JavaScript constrainer (#693)
* refactor: add Go constrainer (#695)
* refactor: add splitter (#676)
* refactor: add C# constrainer (#696)
* refactor: add Java constrainer (#694)
* refactor: simplified constraints and type mapping (#725)
* refactor: convert CSharp to new constraint setup (#735)
* refactor: convert Go to new constraint setup (#732)
* refactor: convert TS to new constraint setup (#736)
* refactor: convert JS to new constraint setup (#741)
* refactor: add object property model (#758)
* chore: refactored model setup to support generators (#766)
* chore: refactored input processors (#767)
* chore: refactored TypeScript and generator implementation (#765)
* chore: refactored Java to new core model (#769)
* chore: refactored Go generator (#771)
* chore: refactored CSharp generator (#770)
* chore: refactored JavaScript generator  (#773)
* chore: refactored dart generator (#778)
* chore: fix build errors (#779)
* chore: fix file generator tests (#782)
* chore: add test and fix constrain implementation (#781)
* chore: fix wrongful import (#783)
* refactor: switch interpretation of pattern properties (#791)
* refactor: fix constrain helpers and add test (#792)
* chore: convert to any model from common model (#793)
* chore: remove old post interpreter and fix tests (#795)
* chore: fix TypeHelpers tests (#802)
* chore: fix generator and renderer tests (#803)
* chore: remove unnecessary common model test (#798)
* chore: remove name helpers (#801)
* chore: fix tests for OutputModel (#800)
* chore: give constrained properties access to the raw property (#799)
* chore: fix enum model conversion (#797)
* chore: fix contains property check failing (#810)
* chore: removed unused property and fix general tests (#809)
* chore: refactor dart generators and test (#796)
* chore: rewrite java generator tests (#804)
* chore: rewrite TypeScript generator tests (#806)
* chore: rewrite CSharp generator tests (#807)
* chore: rewrite javascript generator tests (#805)
* fix: remaining test and implementation issues (#824)
* docs: move banner location (#865)
* docs: update language documentation (#862)
* docs: add migration guidelines (#860)
* docs: update input processing documentation (#859)
* docs: update constraint documentation (#858)
* chore: remove unused functions (#849)
* docs: update usage documentation (#857)
* docs: update preset documentation (#861)
* refactor: simplified example tests (#868)
* chore: add a template for new generators (#850)
* docs: remove duplicate dart output (#892)
* test: update snapshot for failing test (#907)
* chore: add a new example for json-schema-draft4-from-object (#897)
* chore: add a new example for JSON schema draft 6 (#933)
* ci: use @swc/jest to speedup tests (#938)
* ci: fix broken release pipeline (#956)
* docs: add contribution guidelines for processors (#950)
* chore: add missing test dependency for docker (#992)
* docs: add contributing guidelines for presets (#990)
* docs: improve readme with use-cases and examples (#1034)
* chore: add missing blackbox scripts (#1046)
* docs: add versioning and maintenance section (#991)
* test: update snapshots (#1064)
* docs: fix the wrong link to constraint example (#1065)
* test: added example to generate all models within the same file (#1054)
* chore: added prettier config (#838)
* chore: format code (#1088)


Co-authored-by: Kenneth Aasan <[email protected]>
Co-authored-by: Leigh Johnson <[email protected]>
Co-authored-by: Maciej Urbańczyk <[email protected]>
Co-authored-by: Nitin Tejuja <[email protected]>
Co-authored-by: Amit Kumar Sharma <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Andrey Zaytsev <[email protected]>
Co-authored-by: Zbigniew Malcherczyk <[email protected]>
Co-authored-by: Yushi OMOTE <[email protected]>
Co-authored-by: Alejandra Quetzalli  <[email protected]>
Co-authored-by: Artur Ciocanu <[email protected]>
Co-authored-by: Julian R <[email protected]>
Co-authored-by: Anay Sarkar <[email protected]>
Co-authored-by: Louis Xhaferi <[email protected]>
Co-authored-by: Akshat Nema <[email protected]>
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.

3 participants