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

Control generated types access modifier for C# #5284

Merged

Conversation

NKnusperer
Copy link
Contributor

@NKnusperer NKnusperer commented Aug 31, 2024

Add --type-access-modifier flag.
Fixes #4788.

@NKnusperer NKnusperer requested a review from a team as a code owner August 31, 2024 23:35
@NKnusperer
Copy link
Contributor Author

@microsoft-github-policy-service agree

@NKnusperer
Copy link
Contributor Author

NKnusperer commented Aug 31, 2024

Enum support is still missing,
Please review if the current implementation makes sense.

src/Kiota.Builder/Lock/KiotaLockComparer.cs Outdated Show resolved Hide resolved
src/Kiota.Builder/Configuration/GenerationConfiguration.cs Outdated Show resolved Hide resolved
src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

src/kiota/KiotaHost.cs Outdated Show resolved Hide resolved
src/kiota/Handlers/KiotaGenerateCommandHandler.cs Outdated Show resolved Hide resolved
@NKnusperer NKnusperer changed the title Control generated class access modifier for C# Control generated types access modifier for C# Sep 3, 2024
src/Kiota.Builder/Lock/KiotaLock.cs Outdated Show resolved Hide resolved
src/Kiota.Builder/Refiners/CSharpRefiner.cs Outdated Show resolved Hide resolved
@NKnusperer NKnusperer force-pushed the feature/4788-csharp-class-access-modifier branch from d8c57cf to b79a202 Compare September 8, 2024 10:29
Copy link
Member

@andrueastman andrueastman left a comment

Choose a reason for hiding this comment

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

Just a one comment. Otherwise looks good from my end.

src/Kiota.Builder/Refiners/CSharpRefiner.cs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
- Add `--class-access-modifier` flag.
- Rename `--class-access-modifier` to `--type-access-modifier`.
- Use `AccessModifier` enum instead of string and extend to `Internal` value.
- Add `Access` property to `CodeClass` and `CodeEnum`.
- Use `CSharpRefiner` to set `Access` property from configuration.
- Extend `CodeClassDeclarationWriter` and `CodeEnumWriter` to write actual type access modifier.
- Add `TypeAccessModifierOption` to client handlers.
- Add `TypeAccessModifier` to workspace `ApiClientConfiguration` and `ApiClientConfigurationComparer`.
- Add default value of `Public` for stringified `TypeAccessModifier` properties.
- Add test case for `CSharpRefiner`.
- Implement `IAccessibleElement` for `CodeClass` and `CodeEnum`.
- Use parenthesized pattern matching for type checks.
@NKnusperer NKnusperer force-pushed the feature/4788-csharp-class-access-modifier branch from 814ae26 to 307258a Compare September 12, 2024 20:03
baywet
baywet previously approved these changes Sep 13, 2024
Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

Thank you for making the changes!

baywet
baywet previously approved these changes Sep 13, 2024
@baywet baywet modified the milestone: Kiota v1.18.1 Sep 13, 2024
@baywet baywet merged commit fac7928 into microsoft:main Sep 13, 2024
206 of 207 checks passed
@NKnusperer NKnusperer deleted the feature/4788-csharp-class-access-modifier branch September 14, 2024 08:55
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.

Class access modifiers
4 participants