Skip to content

refactor: migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID#386

Merged
CameronRushton merged 7 commits into
asyncapi:masterfrom
gvensan:master
Feb 3, 2026
Merged

refactor: migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID#386
CameronRushton merged 7 commits into
asyncapi:masterfrom
gvensan:master

Conversation

@gvensan
Copy link
Copy Markdown
Collaborator

@gvensan gvensan commented Jan 26, 2026

Description

  • Migrated code generation engine from Nunjucks to React-SDK for improved maintainability and flexibility
  • Added support for complex JSON and AVRO schemas including inheritance, nested objects, and schema constraints (formats, validations)
  • Implemented proper binder configuration for Solace, Kafka, and RabbitMQ with Solace-specific Queue/Topic handling
  • Fixed operationID parsing to handle curly-braces {} in operation identifiers
  • Added efficient schema handling and model class generation for both JSON and AVRO formats
  • Revamped integration tests with support scripts for code generation, compilation, and reporting
  • Added comprehensive support for all template parameters and x-* custom extension overrides
  • Improved documentation with debug logging instructions and test script usage guidelines

Related issue(s)

Broadly, the code changes covers the following:
- Efficient schema handling and class generation (for both JSON and AVRO)
- Support for complex JSON and AVRO schema (inheritences, nested objects and complex schema settings)
- Support for schema settings around field formats, constraints etc
- Proper binder configuration (for Solace, Kafka and RabbitMQ)
- Solace-specific: Queue/Topic handing in the binding configuration
- Revamped integration.test with support scripts for generating code from asyncapi files in mocks and compiling the generated code, generate report
- Support for all the template parameters and x-* custom overrides
@gvensan gvensan changed the title Migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID refactor: Migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID Jan 26, 2026
- Add missing toJavaClassName import in ApplicationYml.js
- Fix duplicate 'properties' key in avroProcessor.js (renamed to propertiesArray)
- Move ModelClass definition before SchemaModel to fix use-before-define
- Refactor nested ternary expressions into helper functions
- Fix brace-style issues (else-if on same line)
- Fix lonely-if by converting to else-if chain
- Add radix parameter to parseInt()
- Prefix intentionally unused variables with underscore
- Remove unused destructured variables in coreProcessor.js
- Update .eslintrc to ignore vars/args prefixed with underscore
- Add .eslintignore to exclude build artifacts
@gvensan gvensan changed the title refactor: Migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID refactor: migrate from nunjucks to react-sdk for code generation and handle curly-braces in operationID Jan 26, 2026
@CameronRushton
Copy link
Copy Markdown
Member

Nothing blocking. Let's have this merged. Thanks for all your hard work!

Comment thread test/integration.test.js
Comment on lines +257 to +259
expect(appJava).toContain('package com.company;');
expect(appJava).toContain('import org.springframework.boot.SpringApplication;');
expect(appJava).toContain('import org.springframework.boot.autoconfigure.SpringBootApplication;');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These expectations feel like a regression from the snapshot testing that was had in the last repo, since it was more thorough with checking the entire file for changes.

CameronRushton
CameronRushton previously approved these changes Jan 27, 2026
- Create utils/processorUtils.js with shared processor functions
- Create utils/schemaModel/BaseSchemaModel.js for common schema logic
- Create utils/packageUtils.js for AVRO package extraction
- Refactor avroProcessor and jsonProcessor to use shared utilities
- Refactor hooks/pre-process.js and post-process.js
- Add helper functions to components/Application.js
- Add test/run_output.sh script for running generated projects
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 3, 2026

@CameronRushton CameronRushton merged commit 34fcd14 into asyncapi:master Feb 3, 2026
10 checks passed
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.

2 participants