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

CPP SDK : changes to handle additional Properties #134

Merged
merged 4 commits into from Oct 18, 2023

Conversation

HaseenaSainul
Copy link
Collaborator

No description provided.

@HaseenaSainul HaseenaSainul force-pushed the features/cpp-addiitonalPropertyHandling branch from ceb7a4a to 04d237b Compare September 29, 2023 05:29
options = options ? JSON.parse(JSON.stringify(options)) : {}

const options2 = JSON.parse(JSON.stringify(options))
options2.parent = title
Copy link
Collaborator

Choose a reason for hiding this comment

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

You've already made a copy on line 143. Why do you need a second copy?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ha, looks like I did that :)

I think the extra copy can go away, though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, I can't find where this new insertObjectAdditionalProperitesMacros method is called.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sorry missed to updated calling place. corrected now

let key = (propertyNames && propertyNames.title) ? propertyNames.title : getTemplate(path.join(options.templateDir, 'additionalPropertiesKey')).trimEnd()

content = content
.replace(/\$\{shape\}/g, shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you confirm that none of the JS templates were using ${property} or ${Property} here?

I forget why I had those two lines in there, but there must have been some reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have not seen any use case from javascript. javascript generation not showed any issue

@@ -27,9 +27,11 @@ const primitives = {
"integer": "number",
"number": "number",
"boolean": "boolean",
"string": "string"
"string": "string",
"float": "float"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The keys in the map are JSON-Schema primitives. JSON-schema does not have a float type, so it should not be here.

Did you come across a schema w/ a float type? I'm surprised it passed validation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

These are just default values for JavaScript. If you need different overrides for Cpp, they can go in the sdk.config.json

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea, it is already overridden language config. I missed to remove. initially I did not clear idea about this setting. finally I understood and missed to remove it

.replace(/\$\{if\.optional\}(.*?)\$\{end\.if\.optional\}/g, ''))
}


Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we be calling insertObjectAdditionalProperitesMacros here, with the same if (schema.additionalProperties... block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated code now to call insertObjectAdditionalProperitesMacros now

const primitive = getPrimitiveType(schemaType, templateDir)
const type = allocatedProxy ? allocatedPrimitiveProxies[schemaType] || primitive : primitive
return wrap(type, code ? '`' : '')
const template = getTemplate(path.join(templateDir, 'additionalProperties'))
Copy link
Collaborator

Choose a reason for hiding this comment

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

The current method (getSchemaType) doesn't recurse into each property...

It looks like you're inserting the Title template if there happens to be a template for additionalProperties

I'm not sure I follow that. Could you explain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

additionalPorperties always seening like a map. FlatMap is additional property and it is map. Here we have to get only its title. FlatMap. hence added logic to get Title.

@@ -644,4 +685,4 @@ export default {
getSchemaType,
getJsonType,
Copy link
Collaborator

Choose a reason for hiding this comment

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

getJSONType wasn't really being used before. I see that you're using it to do some local work in this method, which is cool, but we should stop exporting it now that you've got logic there.

Don't want any external dependencies on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed it

@HaseenaSainul HaseenaSainul merged commit 5695efe into features/cpp Oct 18, 2023
4 checks passed
@HaseenaSainul HaseenaSainul deleted the features/cpp-addiitonalPropertyHandling branch October 18, 2023 03:39
jlacivita added a commit that referenced this pull request Mar 26, 2024
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>
kschrief pushed a commit that referenced this pull request Mar 26, 2024
# [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
kschrief added a commit that referenced this pull request Apr 8, 2024
* 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>
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.

None yet

2 participants