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

c#, fix: class names + namespace conflicts #4229

Merged
merged 16 commits into from
Aug 8, 2024

Conversation

dcb6
Copy link
Contributor

@dcb6 dcb6 commented Aug 7, 2024

C# generator changes:

  • Fixes a bug where conflicting class names and namespaces cause compile to fail.

Seed changes:

  • Prefixing a test with the language causes it to only be run for that language. Logic here

/// This reference to A should not use it's fully qualified name because it's in the same package as A.
/// </summary>
[JsonPropertyName("id")]
public required A Id { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're in the same namespace as A so we don't need to fully qualify

DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};

var deserializedObject = JsonSerializer.Deserialize<SeedCsharpNamespaceConflict.A.A>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fully qualified example

@dcb6 dcb6 marked this pull request as ready for review August 7, 2024 22:35
@dcb6 dcb6 requested a review from dsinghvi as a code owner August 7, 2024 22:35
@@ -7,7 +7,8 @@ import { GeneratorWorkspace } from "../../loadGeneratorWorkspaces";
import { printTestCases } from "./printTestCases";
import { TestRunner } from "./test-runner";

export const FIXTURES_TO_IGNORE = ["sever-sent-event-examples", "server-sent-event-examples"];
export const FIXTURES_TO_IGNORE = ["server-sent-event-examples", "server-sent-events"];
export const LANGUAGE_SPECIFIC_FIXTURE_PREFIXES = ["csharp", "go", "java", "python", "ruby", "ts"];
Copy link
Member

Choose a reason for hiding this comment

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

nice!

@dcb6 dcb6 merged commit ab1ea1a into main Aug 8, 2024
30 of 32 checks passed
@dcb6 dcb6 deleted the burke/fer-2812-c-candid-deconflict-namespace-type branch August 8, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants