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

The code changes primarily involve the addition of a private field `_… #9

Merged
merged 1 commit into from
May 1, 2024

Conversation

temonk
Copy link
Contributor

@temonk temonk commented May 1, 2024

The Default property and its usage have been removed.
The SwaggerTypeHelper class has been updated to remove the Default property from the OpenApiSchema objects it creates for various types.

A new class StringLengthAttribute was added, which is a validation attribute used to assert that a string property, field or parameter does not exceed a maximum length.

…isInitialized` and a private property `_valueOrThrow` in various structs. The `_isInitialized` field is used to check if the struct has been initialized, and the `_valueOrThrow` property returns the value if the struct is initialized, otherwise it throws an `InvalidDomainValueException`. This ensures that a value has been properly initialized before it can be accessed. All methods and properties that previously directly accessed the `_value` field now use the `_valueOrThrow` property. This ensures that an exception is thrown if the struct is not properly initialized before its value is accessed.

The `Default` property and its usage have been removed from several classes and test classes. This suggests that the concept of a "default" value for these types has been removed or refactored. The `SwaggerTypeHelper` class has been updated to remove the `Default` property from the `OpenApiSchema` objects it creates for various types. This suggests that these types no longer have a default value in the context of OpenAPI/Swagger.

A new class `StringLengthAttribute` was added, which is a validation attribute used to assert that a string property, field or parameter does not exceed a maximum length.

The changes are spread across multiple files including `Executor.cs`, `Constants.cs`, `GeneratorData.cs`, `MethodGeneratorHelper.cs`, `AsciiString.cs`, `GDay.cs`, `GMonth.cs`, `GMonthDay.cs`, `GYear.cs`, `GYearMonth.cs`, `NegativeInteger.cs`, `NonEmptyString.cs`, `NonNegativeInteger.cs`, `NonPositiveInteger.cs`, `PositiveInteger.cs`, `IDomainValue.cs`, `DomainPrimitiveGeneratorTest` class, `CharValue` and `DateOnlyValue` structs, `SwaggerTypeHelper` class, `IntOfIntValue` and `IntValue` structs, `StringValue` and `TimeOnlyValue` classes, `TimeSpanValue` and `UShortValue` structs, `IntValue` and `LongValue` structs, and `NonPositiveIntegerTests.cs` and `PositiveIntegerTests.cs` files.
@GregoryNikolaishvili GregoryNikolaishvili merged commit 9158c97 into main May 1, 2024
1 check passed
@temonk temonk deleted the feature/RemovedDefaultValue branch June 19, 2024 07:50
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.

2 participants