Skip to content

Commit

Permalink
Rebase feature/x-subscriber-type (#187)
Browse files Browse the repository at this point in the history
* chore(release): 2.1.1 [skip ci]

## [2.1.1](v2.1.0...v2.1.1) (2023-11-01)

### Bug Fixes

* Errors thrown in async provider methods do not send the JSONRPC error response ([#143](#143)) ([ec8e259](ec8e259))
* Macro not replaced for provider docs ([ef1aecd](ef1aecd))

* chore(release): 2.1.2 [skip ci]

## [2.1.2](v2.1.1...v2.1.2) (2023-11-09)

### Bug Fixes

* Provider openrpc response and error methods have a wrapper object ([#148](#148)) ([373626e](373626e))

* chore(release): 2.2.0 [skip ci]

# [2.2.0](v2.1.2...v2.2.0) (2023-11-30)

### Features

* Improve generated doc formatting ([#155](#155)) ([4613281](4613281))

* Update NOTICE

* chore(release): 2.3.0-next.1 [skip ci]

# [2.3.0-next.1](v2.2.0...v2.3.0-next.1) (2024-01-12)

### Bug Fixes

* Insert 'v' in front of version enum names ([d8b9ada](d8b9ada))
* Proper param handling for x-subscriber-type: global ([02204e5](02204e5))

### Features

* Support for context-free property subscribers ([9809273](9809273))

* Integration of CPPSDK support (#176)

BREAKING CHANGE: Generalized templating engine to support both JavaScript and CPP (and other languages).

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: In progress commit

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* feat(macrofier): Add dynamic schema template output

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* fix: Split c-structs from c (w/ Accessors)

* fix: Latest work

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* Create namespaces only if there is value to put (#117)

* Changes to avoid duplication of sub-array schema with same reference (#116)

* detach setter declaration from property template and add setter templ… (#118)

Detach setter declaration from property template and add setter template, remove unredundant warnings
Cleanup changes, add separator between prefix and subSchema name generation
Introduce excludeDeclarations flag to handle declaration exclusion specific to language
Alignement changes + cleanup + OUT params support added to differentiate method signature parameters
Update in static code

* SubArray generation issue fix (#121)

* cmake changes to install proper files (#119)

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* Create namespaces only if there is value to put (#117)

* Changes to avoid duplication of sub-array schema with same reference (#116)

* detach setter declaration from property template and add setter templ… (#118)

Detach setter declaration from property template and add setter template, remove unredundant warnings
Cleanup changes, add separator between prefix and subSchema name generation
Introduce excludeDeclarations flag to handle declaration exclusion specific to language
Alignement changes + cleanup + OUT params support added to differentiate method signature parameters
Update in static code

* SubArray generation issue fix (#121)

* cmake changes to install proper files (#119)

* native code: changed return type from uint32_t to int32_t (#127)

* fix: Provider Interfaces and Tuples in JS

* feat: Initial commit of cpp sdk

* feat: Fix issues in generated headers

* CPPSDK: static code + template changes (#137)

* CPPSDK: static code + template changes

* CPPSDK: static code updates

* CPPSDK: updates in error handling

* CPPSDK: namespace settings changes (#135)

* CPP SDK : changes to handle additional Properties (#134)

CPP SDK : changes to handle additional Properties

* CPPSDK: parameter and result handling changes (#136)

CPPSDK:
1. parameter and result handling changes
2. anyOf type handling
3. reference schema handling

* CPPSDK: aggregate files based on suffix type handling added, module and override module generation also handled (#139)

CPPSDK: aggregate files based on suffix type handling added, module and override module generation also handled

* CPPSDK: changes to handle enum and x-schema enum without title (#138)

* CPPSDK: parameter/result handling for method and events + inner object handling (#140)

* CPPSDK: template added for capabilties-method (#142)

* CPPSDK: method name changed to camel case (#144)

* CPPSDK: event name changed to camelcase (#145)

* CPPSDK: add overrideRule to handle template generation + remove enum level checking (#141)

1. Add properties to the template only if object has properties or additionalProperties
2. use primitive types from templates, instead defined variable

* CPPSDK: remove const from return type (#149)

* CPPSDK: typo fix (#150)

* CPPSDK: handle empty properties and propertyNames with templates (#152)

* CPPSDK: code generation template and engine changes (#151)

1. Callback generation + types: with generation changes + template updates
2.Set title for properties inside x-schemas

* CPPSDK: template updates based on more complex schema generation (#153)

* CPPSDK: polymorphic-pull method/event generation support added (#154)

* CPPSDK: provider support added (#156)

* CPPSDK: check jsonrpc response values are set or not before assigning based on optional types (#157)

* fix: Copy allow-focus tag to use methods

* CPPSDK: calls metrics support added (#158)

* CPPSDK: calls metrics support added

* CPPSDK: handle patternProperties (#160)

* CPPSDK: polymorphic method schema creation changes (#159)

* CPPSDK: changes to handle context params (#161)

* CPPSDK: warning fix during promoteAndNameSubSchemas (#163)

* Check template for codeblocks exists or not before trying to generate (#164)

* Optimization of generation time: generate macros only based on the schemhema template requirement if it is set (#165)

* Updates based on MAC testing (#167)

* CPPSDK: proceed to install only the build is successfully done and some cleanup (#169)

* merge conflict fixes

* feature/cpp branch alignment based on next branch merging for both openrpc and apis (#171)

* CPPSDK: update install script to handle version parsing for file based and prebuild install cases (#173)

* Update to align generated firebolt.d.ts sync with same is next branch (#172)

* CPPSDK : Add Async communication support and CPP code generation for x-uses + x-allow-focus=true (#170)

---------

Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>
Co-authored-by: sramani-metro <71630728+sramani-metro@users.noreply.github.com>
Co-authored-by: Santhosh Ramani <s.ramani@metrological.com>

* chore(release): 3.0.0-next.1 [skip ci]

# [3.0.0-next.1](v2.3.0-next.1...v3.0.0-next.1) (2024-03-26)

* Integration of CPPSDK support (#176) ([89294cc](89294cc)), closes [#176](#176) [#90](#90) [#93](#93) [#94](#94) [#96](#96) [#97](#97) [#100](#100) [#99](#99) [#101](#101) [#102](#102) [#107](#107) [#106](#106) [#105](#105) [#103](#103) [#109](#109) [#112](#112) [#111](#111) [#113](#113) [#114](#114) [#115](#115) [#110](#110) [#90](#90) [#93](#93) [#94](#94) [#96](#96) [#97](#97) [#100](#100) [#99](#99) [#101](#101) [#102](#102) [#107](#107) [#106](#106) [#105](#105) [#103](#103) [#109](#109) [#112](#112) [#111](#111) [#113](#113) [#114](#114) [#115](#115) [#110](#110) [#117](#117) [#116](#116) [#118](#118) [#121](#121) [#119](#119) [#90](#90) [#93](#93) [#94](#94) [#96](#96) [#97](#97) [#100](#100) [#99](#99) [#101](#101) [#102](#102) [#107](#107) [#106](#106) [#105](#105) [#103](#103) [#109](#109) [#112](#112) [#111](#111) [#113](#113) [#114](#114) [#115](#115) [#110](#110) [#117](#117) [#116](#116) [#118](#118) [#121](#121) [#119](#119) [#127](#127) [#137](#137) [#135](#135) [#134](#134) [#136](#136) [#139](#139) [#138](#138) [#140](#140) [#142](#142) [#144](#144) [#145](#145) [#141](#141) [#149](#149) [#150](#150) [#152](#152) [#151](#151) [#153](#153) [#154](#154) [#156](#156) [#157](#157) [#158](#158) [#160](#160) [#159](#159) [#161](#161) [#163](#163) [#164](#164) [#165](#165) [#167](#167) [#169](#169) [#171](#171) [#173](#173) [#172](#172) [#170](#170)

### BREAKING CHANGES

* Generalized templating engine to support both JavaScript and CPP (and other languages).

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* feat: CI/CD Merging from next (#183)

* Push new workflows

* chore(release): 3.0.0-next.2 [skip ci]

# [3.0.0-next.2](v3.0.0-next.1...v3.0.0-next.2) (2024-04-08)

### Features

* CI/CD Merging from next ([#183](#183)) ([14476a9](14476a9))

* CPPSDK: ensure array has enough data before trying to access (#184)

* CPPSDK: cmake prefix to support older release as well (#180)

Co-authored-by: kschrief <kschriefer91@gmail.com>

* CPPSDK: remove reduntant code (#178)

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: In progress commit

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* feat(macrofier): Add dynamic schema template output

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* fix: Split c-structs from c (w/ Accessors)

* fix: Latest work

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* Create namespaces only if there is value to put (#117)

* Changes to avoid duplication of sub-array schema with same reference (#116)

* detach setter declaration from property template and add setter templ… (#118)

Detach setter declaration from property template and add setter template, remove unredundant warnings
Cleanup changes, add separator between prefix and subSchema name generation
Introduce excludeDeclarations flag to handle declaration exclusion specific to language
Alignement changes + cleanup + OUT params support added to differentiate method signature parameters
Update in static code

* SubArray generation issue fix (#121)

* cmake changes to install proper files (#119)

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

* fix: Sort the macrofied schemas based on schema refs (#90)

* fix: Sort the macrofied schemas based on schema refs

* fix: Sort the schemas before macrofying

* fix: Handle the schemas part

* Enum fixes (#93)

Enum fixes :
1. missing description added
2. alignment fixes
3. implementation added for enum inside properties
4. Enum to String value Conversion logic added for C

* Types and Accessor related fixes (#94)

Types and Accessor related fixes:
1. Accessor creation
2. JsonContainer creation
3. Types order placed based on depenedencies
4. filtered redundant new lines
5. UnamedSchema issue fixes
6. Types and Accessors:  generation added for objects inside methods result/params
7. AnyOf support added

* Static code implementation updates (#96)

Static code implementation updates
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>

* Add support to generate file inclusion for common schema also (#97)

Add support to generate file inclusion for common schema also

* C-Language: Templates based property methods (#100)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* Add support to keep original file permissions of template/sdk files (#99)

* Event template implementation added (#101)

* Template for Polymorphic pull method (#102)

* feat: Add method templates for properties

* feat: Property setters using templates

* fix: Macro name correction

* feat: Add template for polymorphic-pull

* fix: Promote and name sub-schemas in one place

* fix: Add extractSubSchemas flag to C language

* fix: Uncomment writeFilePermissions

* polymorphic-pull: method and event implementation added (#107)

* SchemaSorting: logic updated to consider all schemas (#106)

* fix: Fix the reentrancy of methods from callback (#105)

* Default template implementation added (#103)

Default template implementation added

* Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix (#109)

Naming + void* to struct* changes based on sky review, removed redundant code, array handling fix

* language-c: re-arrange files locations (#112)

language-c: re-arrange files locations

* fixes to generate array inside subschemas (#111)

* include test always (#113)

* use String type if there is any issue with anyOf merge (#114)

* calls-metrics: support added (#115)

* Generate polymorphci methods for anyOf param/result case (#110)

* Create namespaces only if there is value to put (#117)

* Changes to avoid duplication of sub-array schema with same reference (#116)

* detach setter declaration from property template and add setter templ… (#118)

Detach setter declaration from property template and add setter template, remove unredundant warnings
Cleanup changes, add separator between prefix and subSchema name generation
Introduce excludeDeclarations flag to handle declaration exclusion specific to language
Alignement changes + cleanup + OUT params support added to differentiate method signature parameters
Update in static code

* SubArray generation issue fix (#121)

* cmake changes to install proper files (#119)

* native code: changed return type from uint32_t to int32_t (#127)

* fix: Provider Interfaces and Tuples in JS

* feat: Initial commit of cpp sdk

* feat: Fix issues in generated headers

* CPPSDK: static code + template changes (#137)

* CPPSDK: static code + template changes

* CPPSDK: static code updates

* CPPSDK: updates in error handling

* CPPSDK: namespace settings changes (#135)

* CPP SDK : changes to handle additional Properties (#134)

CPP SDK : changes to handle additional Properties

* CPPSDK: parameter and result handling changes (#136)

CPPSDK:
1. parameter and result handling changes
2. anyOf type handling
3. reference schema handling

* CPPSDK: aggregate files based on suffix type handling added, module and override module generation also handled (#139)

CPPSDK: aggregate files based on suffix type handling added, module and override module generation also handled

* CPPSDK: changes to handle enum and x-schema enum without title (#138)

* CPPSDK: parameter/result handling for method and events + inner object handling (#140)

* CPPSDK: template added for capabilties-method (#142)

* CPPSDK: method name changed to camel case (#144)

* CPPSDK: event name changed to camelcase (#145)

* CPPSDK: add overrideRule to handle template generation + remove enum level checking (#141)

1. Add properties to the template only if object has properties or additionalProperties
2. use primitive types from templates, instead defined variable

* CPPSDK: remove const from return type (#149)

* CPPSDK: typo fix (#150)

* CPPSDK: handle empty properties and propertyNames with templates (#152)

* CPPSDK: code generation template and engine changes (#151)

1. Callback generation + types: with generation changes + template updates
2.Set title for properties inside x-schemas

* CPPSDK: template updates based on more complex schema generation (#153)

* CPPSDK: polymorphic-pull method/event generation support added (#154)

* CPPSDK: provider support added (#156)

* CPPSDK: check jsonrpc response values are set or not before assigning based on optional types (#157)

* fix: Copy allow-focus tag to use methods

* CPPSDK: calls metrics support added (#158)

* CPPSDK: calls metrics support added

* CPPSDK: handle patternProperties (#160)

* CPPSDK: polymorphic method schema creation changes (#159)

* CPPSDK: changes to handle context params (#161)

* CPPSDK: warning fix during promoteAndNameSubSchemas (#163)

* Check template for codeblocks exists or not before trying to generate (#164)

* Optimization of generation time: generate macros only based on the schemhema template requirement if it is set (#165)

* Updates based on MAC testing (#167)

* CPPSDK: proceed to install only the build is successfully done and some cleanup (#169)

* merge conflict fixes

* feature/cpp branch alignment based on next branch merging for both openrpc and apis (#171)

* CPPSDK: update install script to handle version parsing for file based and prebuild install cases (#173)

* Update to align generated firebolt.d.ts sync with same is next branch (#172)

* CPPSDK : Add Async communication support and CPP code generation for x-uses + x-allow-focus=true (#170)

* CPPSDK: remove reduntant code

---------

Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>
Co-authored-by: sramani-metro <71630728+sramani-metro@users.noreply.github.com>
Co-authored-by: Santhosh Ramani <s.ramani@metrological.com>
Co-authored-by: kschrief <kschriefer91@gmail.com>

* fix: Account for new OpenRPC spec URL contents (#186)

* fix: Account for new openRpcSpec URL contents

* chore(release): 3.0.0-next.3 [skip ci]

# [3.0.0-next.3](v3.0.0-next.2...v3.0.0-next.3) (2024-05-09)

### Bug Fixes

* Account for new OpenRPC spec URL contents ([#186](#186)) ([66bd6ac](66bd6ac))

---------

Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net>
Co-authored-by: Kevin Pearson <kevin_pearson@cable.comcast.com>
Co-authored-by: Jeremy LaCivita <jeremy.lacivita@comcast.com>
Co-authored-by: HaseenaSainul <41037131+HaseenaSainul@users.noreply.github.com>
Co-authored-by: sramani-metro <71630728+sramani-metro@users.noreply.github.com>
Co-authored-by: Santhosh Ramani <s.ramani@metrological.com>
Co-authored-by: kschrief <kschriefer91@gmail.com>
  • Loading branch information
8 people committed May 14, 2024
1 parent b5be88e commit daa0d06
Show file tree
Hide file tree
Showing 554 changed files with 11,059 additions and 322 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/merge-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Attempt to merge next to main
on:
workflow_dispatch:

jobs:
# Check if next can merge into main
perform_merge:
name: Perform merge if "next" can merge into "main"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }}
persist-credentials: true

# Set user identity
- name: Set-Identity
run: |
git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}"
git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}"
# Checkout "main"
- name: Checkout main
run: git checkout "main"

- name: Perform the merge from next to main
run: |
git merge next
git push origin "main"
echo "Push to main succeeded"
# If the merge cannot be performed, let stakeholders know
message_on_failure:
name: Merge failure
needs: perform_merge
runs-on: ubuntu-latest
if: ${{ failure() }}

steps:
- name: Post error message (To-Do)
run: echo "Next cannot be merged into main cleanly"
72 changes: 72 additions & 0 deletions .github/workflows/merge-to-next-major.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Attempt to merge next to next-major
on:
workflow_dispatch:
push:
branches:
- "next"

jobs:
# Check if next can merge into next-major
perform_merge:
name: Perform merge if "next" can merge into "next-major"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
repo-token: ${{ secrets.SEMANTIC_RELEASE_BOT_PAT }}
persist-credentials: true

# Set user identity
- name: Set-Identity
run: |
git config --global user.email "${{ secrets.GLOBAL_GITHUB_EMAIL }}"
git config --global user.name "${{ secrets.GLOBAL_GITHUB_USER }}"
# Checkout "next-major"
- name: Checkout next-major
run: git checkout "next-major"

# Get the "next-major" version number
- name: Extract next-major version
id: extract_version
run: echo "::set-output name=version::$(node -e 'console.log(require("./package.json").version)')"

# Checkout "next"
- name: Checkout next
run: git checkout "next"

# Update "next" version to match "next-major"
- name: Update "next" version to match "next-major"
run: |
jq '.version = "${{ steps.extract_version.outputs.version }}"' package.json > temp.json
if diff -q "package.json" "temp.json" >/dev/null; then
echo "Versions are identical. No change required."
rm temp.json
else
mv temp.json package.json
git add package.json && git commit -m "Sync version to ${{ steps.extract_version.outputs.version }}"
fi
# Checkout "next-major"
- name: Checkout next-major
run: git checkout "next-major"

- name: Perform the merge from next to next-major
run: |
git merge next
git push origin "next-major"
echo "Push to next-major succeeded"
# If the merge cannot be performed, let stakeholders know
message_on_failure:
name: Merge failure
needs: perform_merge
runs-on: ubuntu-latest
if: ${{ failure() }}

steps:
- name: Post error message (To-Do)
run: echo "Next cannot be merged into next-major cleanly"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/*
.DS_Store
.DS_Store
coverage
.vscode/settings.json
61 changes: 59 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,74 @@
# [2.2.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1-next.3...v2.2.0-next.1) (2023-11-30)
# [3.0.0-next.3](https://github.com/rdkcentral/firebolt-openrpc/compare/v3.0.0-next.2...v3.0.0-next.3) (2024-05-09)


### Bug Fixes

* Account for new OpenRPC spec URL contents ([#186](https://github.com/rdkcentral/firebolt-openrpc/issues/186)) ([66bd6ac](https://github.com/rdkcentral/firebolt-openrpc/commit/66bd6acc1ffdaefadcb46d78864d615a116b5a85))

# [3.0.0-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v3.0.0-next.1...v3.0.0-next.2) (2024-04-08)


### Features

* CI/CD Merging from next ([#183](https://github.com/rdkcentral/firebolt-openrpc/issues/183)) ([14476a9](https://github.com/rdkcentral/firebolt-openrpc/commit/14476a908f2c10d907417187c41ce255ac2ea6a6))

# [3.0.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.3.0-next.1...v3.0.0-next.1) (2024-03-26)


* Integration of CPPSDK support (#176) ([89294cc](https://github.com/rdkcentral/firebolt-openrpc/commit/89294cc37f23a94012621130858e01c946a3a9a6)), closes [#176](https://github.com/rdkcentral/firebolt-openrpc/issues/176) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#117](https://github.com/rdkcentral/firebolt-openrpc/issues/117) [#116](https://github.com/rdkcentral/firebolt-openrpc/issues/116) [#118](https://github.com/rdkcentral/firebolt-openrpc/issues/118) [#121](https://github.com/rdkcentral/firebolt-openrpc/issues/121) [#119](https://github.com/rdkcentral/firebolt-openrpc/issues/119) [#90](https://github.com/rdkcentral/firebolt-openrpc/issues/90) [#93](https://github.com/rdkcentral/firebolt-openrpc/issues/93) [#94](https://github.com/rdkcentral/firebolt-openrpc/issues/94) [#96](https://github.com/rdkcentral/firebolt-openrpc/issues/96) [#97](https://github.com/rdkcentral/firebolt-openrpc/issues/97) [#100](https://github.com/rdkcentral/firebolt-openrpc/issues/100) [#99](https://github.com/rdkcentral/firebolt-openrpc/issues/99) [#101](https://github.com/rdkcentral/firebolt-openrpc/issues/101) [#102](https://github.com/rdkcentral/firebolt-openrpc/issues/102) [#107](https://github.com/rdkcentral/firebolt-openrpc/issues/107) [#106](https://github.com/rdkcentral/firebolt-openrpc/issues/106) [#105](https://github.com/rdkcentral/firebolt-openrpc/issues/105) [#103](https://github.com/rdkcentral/firebolt-openrpc/issues/103) [#109](https://github.com/rdkcentral/firebolt-openrpc/issues/109) [#112](https://github.com/rdkcentral/firebolt-openrpc/issues/112) [#111](https://github.com/rdkcentral/firebolt-openrpc/issues/111) [#113](https://github.com/rdkcentral/firebolt-openrpc/issues/113) [#114](https://github.com/rdkcentral/firebolt-openrpc/issues/114) [#115](https://github.com/rdkcentral/firebolt-openrpc/issues/115) [#110](https://github.com/rdkcentral/firebolt-openrpc/issues/110) [#117](https://github.com/rdkcentral/firebolt-openrpc/issues/117) [#116](https://github.com/rdkcentral/firebolt-openrpc/issues/116) [#118](https://github.com/rdkcentral/firebolt-openrpc/issues/118) [#121](https://github.com/rdkcentral/firebolt-openrpc/issues/121) [#119](https://github.com/rdkcentral/firebolt-openrpc/issues/119) [#127](https://github.com/rdkcentral/firebolt-openrpc/issues/127) [#137](https://github.com/rdkcentral/firebolt-openrpc/issues/137) [#135](https://github.com/rdkcentral/firebolt-openrpc/issues/135) [#134](https://github.com/rdkcentral/firebolt-openrpc/issues/134) [#136](https://github.com/rdkcentral/firebolt-openrpc/issues/136) [#139](https://github.com/rdkcentral/firebolt-openrpc/issues/139) [#138](https://github.com/rdkcentral/firebolt-openrpc/issues/138) [#140](https://github.com/rdkcentral/firebolt-openrpc/issues/140) [#142](https://github.com/rdkcentral/firebolt-openrpc/issues/142) [#144](https://github.com/rdkcentral/firebolt-openrpc/issues/144) [#145](https://github.com/rdkcentral/firebolt-openrpc/issues/145) [#141](https://github.com/rdkcentral/firebolt-openrpc/issues/141) [#149](https://github.com/rdkcentral/firebolt-openrpc/issues/149) [#150](https://github.com/rdkcentral/firebolt-openrpc/issues/150) [#152](https://github.com/rdkcentral/firebolt-openrpc/issues/152) [#151](https://github.com/rdkcentral/firebolt-openrpc/issues/151) [#153](https://github.com/rdkcentral/firebolt-openrpc/issues/153) [#154](https://github.com/rdkcentral/firebolt-openrpc/issues/154) [#156](https://github.com/rdkcentral/firebolt-openrpc/issues/156) [#157](https://github.com/rdkcentral/firebolt-openrpc/issues/157) [#158](https://github.com/rdkcentral/firebolt-openrpc/issues/158) [#160](https://github.com/rdkcentral/firebolt-openrpc/issues/160) [#159](https://github.com/rdkcentral/firebolt-openrpc/issues/159) [#161](https://github.com/rdkcentral/firebolt-openrpc/issues/161) [#163](https://github.com/rdkcentral/firebolt-openrpc/issues/163) [#164](https://github.com/rdkcentral/firebolt-openrpc/issues/164) [#165](https://github.com/rdkcentral/firebolt-openrpc/issues/165) [#167](https://github.com/rdkcentral/firebolt-openrpc/issues/167) [#169](https://github.com/rdkcentral/firebolt-openrpc/issues/169) [#171](https://github.com/rdkcentral/firebolt-openrpc/issues/171) [#173](https://github.com/rdkcentral/firebolt-openrpc/issues/173) [#172](https://github.com/rdkcentral/firebolt-openrpc/issues/172) [#170](https://github.com/rdkcentral/firebolt-openrpc/issues/170)


### BREAKING CHANGES

* Generalized templating engine to support both JavaScript and CPP (and other languages).

* chore: Copy JS templates to C and create language.config.json

* feat(languages): Add support for a distinct JSON-type for each schema

Also started tweaking C templates and adding a few useful macros.

* chore: Dropped debug logs

* fix: Stop passing non-schemas in to getSchemaType

* feat(accessors): New macro section for schema property accessors

# [2.3.0-next.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.2.0...v2.3.0-next.1) (2024-01-12)


### Bug Fixes

* Insert 'v' in front of version enum names ([d8b9ada](https://github.com/rdkcentral/firebolt-openrpc/commit/d8b9ada1b624df29821b74679291d36167208470))
* Proper param handling for x-subscriber-type: global ([02204e5](https://github.com/rdkcentral/firebolt-openrpc/commit/02204e5f93d27a21086b4a9bbe5f586f969354f8))


### Features

* Support for context-free property subscribers ([9809273](https://github.com/rdkcentral/firebolt-openrpc/commit/980927309fa6efc7b03a490aa5fd7909f39ff4de))

# [2.2.0](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.2...v2.2.0) (2023-11-30)


### Features

* Improve generated doc formatting ([#155](https://github.com/rdkcentral/firebolt-openrpc/issues/155)) ([4613281](https://github.com/rdkcentral/firebolt-openrpc/commit/46132810ac5e5b0a8b9baa22903cb8a367b46f63))

## [2.1.1-next.3](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1-next.2...v2.1.1-next.3) (2023-11-09)
## [2.1.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1...v2.1.2) (2023-11-09)


### Bug Fixes

* Provider openrpc response and error methods have a wrapper object ([#148](https://github.com/rdkcentral/firebolt-openrpc/issues/148)) ([373626e](https://github.com/rdkcentral/firebolt-openrpc/commit/373626ed598447bb670ac67e97ca8ed1bf32f28f))

## [2.1.1](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.0...v2.1.1) (2023-11-01)


### Bug Fixes

* Errors thrown in async provider methods do not send the JSONRPC error response ([#143](https://github.com/rdkcentral/firebolt-openrpc/issues/143)) ([ec8e259](https://github.com/rdkcentral/firebolt-openrpc/commit/ec8e2599d530f9d2bd38fbb53b36e13c038edf2a))
* Macro not replaced for provider docs ([ef1aecd](https://github.com/rdkcentral/firebolt-openrpc/commit/ef1aecd0092a8652bc7b936604f9478b7b55df27))

## [2.1.1-next.2](https://github.com/rdkcentral/firebolt-openrpc/compare/v2.1.1-next.1...v2.1.1-next.2) (2023-11-01)


Expand Down
27 changes: 27 additions & 0 deletions languages/c-structs/language.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "C",
"langcode": "c",
"createModuleDirectories": false,
"extractSubSchemas": true,
"unwrapResultObjects": true,
"convertTuplesToArraysOrObjects": true,
"templatesPerModule": [
"/include/module.h",
"/src/module.cpp"
],
"templatesPerSchema": [
"/include/common/module.h",
"/src/module_common.cpp",
"/src/jsondata_module.h"
],
"persistPermission": true,
"primitives": {
"boolean": "bool",
"integer": "int",
"number": "float",
"string": "char*"
},
"additionalSchemaTemplates": [
"json-types"
]
}
19 changes: 19 additions & 0 deletions languages/c-structs/src/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright 2021 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/

export { default as Transport } from './shared/Transport/index.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/export.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as ${info.title} } from './${info.title}/index.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/mock-import.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import { default as _${info.title} } from './${info.title}/defaults.mjs'
1 change: 1 addition & 0 deletions languages/c-structs/templates/codeblocks/mock-parameter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${info.title}: _${info.title},
Empty file.
9 changes: 9 additions & 0 deletions languages/c-structs/templates/codeblocks/setter.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* ${method.name} - ${method.description} */
uint32_t ${info.title}_${method.Name}( ${method.signature.params} )
{
const string method = _T("${info.title}.${method.name}");
${if.params}
${method.params.serialization}
${end.if.params}
return FireboltSDK::Properties::Set(method, jsonParameters);
}
Empty file.
5 changes: 5 additions & 0 deletions languages/c-structs/templates/declarations/default.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties});
4 changes: 4 additions & 0 deletions languages/c-structs/templates/declarations/event.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${method.name} - ${method.description} */
typedef void (*F${info.Title}${method.Name}Callback)( const void* userData, ${event.signature.callback.params}${if.event.params}, ${end.if.event.params}${method.result.properties} );
int F${info.title}_Register_${method.Name}( ${event.signature.params}${if.event.params}, ${end.if.event.params}F${info.Title}${method.Name}Callback userCB, const void* userData );
int F${info.title}_Unregister_${method.Name}( F${info.Title}${method.Name}Callback userCB);
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_${method.Name}(${method.signature.params}${if.result.properties}${if.params}, ${end.if.params}${end.if.result.properties}${method.result.properties});
5 changes: 5 additions & 0 deletions languages/c-structs/templates/declarations/property.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* ${method.summary}
* ${method.params}
*/
int F${info.title}_Get${method.Name}(${method.signature.params}${if.params}, ${end.if.params}${method.result.properties});
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "jsondata_${info.title.lowercase}.h"
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "common/${info.title.lowercase}.h"
1 change: 1 addition & 0 deletions languages/c-structs/templates/imports/default.jsondata
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "jsondata_${info.title.lowercase}.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// need cpp code to init, get, set, clear additional properties...
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/anyOf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* AnyOf is not supported in C: ${title} */
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/array.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
uint32_t ${info.Title}_${Title}Array_Size(${type} handle);
${type} ${title}Array_Get(${type} handle, uint32_t index);
void ${info.Title}_${Title}Array_Add(${propertyType} handle, ${valueType} value);
void ${info.Title}_${Title}Array_Clear(${propertyType} handle);
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/boolean.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::Boolean
Empty file.
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/default.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${shape}
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/enum.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${title} ${description} */
ENUM_CONVERSION_BEGIN(${name})
{ ${NAME}_${key}, _T("${value}") },
ENUM_CONVERSION_END(${name})
4 changes: 4 additions & 0 deletions languages/c-structs/templates/json-types/enum.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* ${title} ${description} */
typedef enum {
${NAME}_${key},
} ${name};
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/float.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::Float
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/integer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WPEFramework::Core::JSON::DecSInt32
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/namespace.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FireboltSDK::${info.Title}::
25 changes: 25 additions & 0 deletions languages/c-structs/templates/json-types/object.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class ${title}: public WPEFramework::Core::JSON::Container {
public:
~${title}() override = default;

public:
${title}()
: WPEFramework::Core::JSON::Container()
{
${properties.register}
}

${title}(const ${title}& other)
{
${properties.assign}
}

${title}& operator=(const ${title}& other)
{
${properties.assign}
return (*this);
}

public:
${properties}
};
Empty file.
2 changes: 2 additions & 0 deletions languages/c-structs/templates/json-types/property-assign.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add(_T("${property}"), &${Property});
${Property} = other.${Property}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add(_T("${property}"), &${Property});
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/property.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${title} ${Property};
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/ref.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${shape}
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/string.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FireboltSDK::JSON::String
1 change: 1 addition & 0 deletions languages/c-structs/templates/json-types/title.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JsonData_${Title}
Loading

0 comments on commit daa0d06

Please sign in to comment.