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

adds support for deserialization of composed types #1603

Merged
merged 75 commits into from
Sep 8, 2022

Conversation

baywet
Copy link
Member

@baywet baywet commented May 31, 2022

fixes #1411

@baywet baywet added the generator Issues or improvements relater to generation capabilities. label May 31, 2022
@baywet baywet self-assigned this May 31, 2022
Base automatically changed from feature/request-unknown-types to main June 2, 2022 07:15
@baywet baywet force-pushed the feature/union-types-serialization branch from fed80d0 to a434cc8 Compare June 20, 2022 18:48
@baywet baywet force-pushed the feature/union-types-serialization branch 2 times, most recently from b435ae8 to 8a3489b Compare June 29, 2022 15:23
@baywet baywet force-pushed the feature/union-types-serialization branch 2 times, most recently from 99b09fb to 2e0179a Compare July 12, 2022 20:16
@baywet baywet force-pushed the feature/union-types-serialization branch from 2e0179a to 17a2660 Compare July 14, 2022 20:26
@baywet baywet force-pushed the feature/union-types-serialization branch 2 times, most recently from b2a5eb3 to 1c8f8b2 Compare August 12, 2022 19:29
@baywet baywet force-pushed the feature/union-types-serialization branch 3 times, most recently from d2a8dae to af2e08f Compare August 22, 2022 20:02
@baywet baywet force-pushed the feature/union-types-serialization branch 2 times, most recently from 75949b0 to 81ae9ec Compare September 2, 2022 14:35
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
src/Kiota.Builder/Writers/LanguageWriter.cs Show resolved Hide resolved
if(entry.Value.AllOf != null)
foreach(var allOfEntry in entry.Value.AllOf.Where(static x => !string.IsNullOrEmpty(x.Reference?.Id))) {
var dependents = inheritanceIndex.GetOrAdd(allOfEntry.Reference.Id, new ConcurrentDictionary<string, bool>(StringComparer.OrdinalIgnoreCase));
dependents.TryAdd(entry.Key, false);
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm, the reason we have dummy values is because we do not have a data structure like a ConcurrentHashSet in the .Net Api? Otherwise, there would be no need for the dummy false values. Yes?

Copy link
Member Author

Choose a reason for hiding this comment

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

correct, the general recommendation is to use a concurrent dictionary instead.

src/Kiota.Builder/KiotaBuilder.cs Outdated Show resolved Hide resolved
@rkodev
Copy link
Contributor

rkodev commented Sep 7, 2022

LGTM

Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
@baywet baywet requested a review from andrueastman September 7, 2022 18:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

91.4% 91.4% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generator Issues or improvements relater to generation capabilities.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime support of union types is limited to TypeScript clients
3 participants