Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for composed types in Typescript (#4602)
* initial commit for composed types implementation for typescript * use inline declaration of composed types instead of wrapper types * serialize primitive union types * finished adding support for composed types comprised of union of primitives * use more meaningful naming & semantics * refactor large methods * unit test for TypescriptRefiner * ad dopen api test file * unit tests for Typescript refiner * test coverage - cover all cases * minor cleanup refactor for TypeScript/CodeFunctionWriter.cs * access the conventions service from static context * move the method to get factory name to the conventions service * refactor composed type to use specific writers * increase coverage * increase code coverage * handle union of objects in typescript * remove unused code * add serialization for union objects * fix failing test and improve coverage * add pets union test yml file * remove unused parameter * retrieve serialization method correctly * rectify the serilaization function for CodeUnion types * **allow primitive intersection types as per existing yml test file * typescript: add support for intersection type objects * fix primitive intersection bug * refactor the factory method for primitive composed type values * removed unused import statement * inline composed types * remove unused param * fix sonar warnings * format code * address pr comments * adress pr comments * address pr comments * address pr comments * address pr coments * format code * address pr comments * increase test coverage * increase test coverage * address pr comments * address pr comments * address pr comments * address pr comments * remove reference to external urls on tests * simplify open api sample test files * address pr comments * address pr comments, format code * address pr comments * fix failing test * address pr comments * format code * apply pr suggestion to other places for consistency * enable supressed typescript tests * allow generation to constinue when the discriminator property is missing * fix failing it tests * fix it test compilation error 'parseNode' is possibly 'undefined' for apisguru::twitter.com:current * fix failing test * fix failing it test * ignore null default values * ignore 'null' default values * omit null from default values while serializing * exclude apisguru::stripe.com integration test from running since it contains intersection type between objects and primitive values which isn't supported in typescript * address pr comments * format code * fix sonar warnings * search for factory function using namespace only * use a more meaningful method name * appply pr suggestion * refactor code remove new enum values * format code * remove unused parameters * fix compilation issue * remove unused deserializer * simplify statement * apply pr review suggestions * remove unused parameter * use | symbol for code intersection in typescript * move composed-type utility method to extensions * remove CodeComposedTypeBase extension class * use Nullish Coalescing Operator ?? over logical or || * handle edge cases for composed types - Union of objects and primitive types without discriminator property * format code * remove unused code in CodeMethod.cs * delete unused method * import all associated deserializers for composed types * remove collection symbol for composed type param in serailizer and deserializer functions * handle endge cases where composed type is a mix of objects and/or array of objects and/or primitive values * fix casing * add serialization functions to obsolete class definitions to prevent typescript refiner from throwing exceptions * use correct serialization method for composed type collection * improve code coverage * Refactor composed types * fix: null check on composed types * fix: type casting * Fix serialization * Fix serialization with differenterent types * Fixes import collition for types * Fix import types * Fix import * Fix unit tests * minor refactr * Find correct function * fix: formatting * fix: unit tests * fix: tests * format code * rafactor: reduce code complexity * fix: String as value * feat: add unit tests * code cleanup * sonar cleanup * fix: compilation errors from main branch * Update src/Kiota.Builder/CodeDOM/CodeComposedTypeBase.cs * fix: typo --------- Co-authored-by: rkodev <[email protected]> Co-authored-by: Vincent Biret <[email protected]>
- Loading branch information