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

Fix NodaTime Serialization #216

Merged
merged 7 commits into from
Jul 21, 2024

Conversation

TheTedder
Copy link
Contributor

This PR fixes an issue where NodaTime types such as Instant and Duration were being serialized as objects instead of string values. It also gets rid of the schema filter that marks all non-nullable types as required in the openapi spec. It's better to just use the required keyword so there's no ambiguity.

@TheTedder TheTedder requested a review from a team as a code owner July 18, 2024 17:02
@TheTedder TheTedder requested a review from zysim July 20, 2024 22:00
@zysim zysim merged commit eaabe27 into leaderboardsgg:next Jul 21, 2024
1 check passed
TheTedder added a commit to TheTedder/leaderboard-backend that referenced this pull request Aug 11, 2024
* Add NodaTime and related packages.

* Configure NodaTime serialization.

* Remove RequiredNotNullableSchemaFilter.

* Update openapi.json.

* Configure JsonSerializerOptions for tests.

* Fix Instant example values.

* Choose an example ZonedDateTime.
TheTedder added a commit that referenced this pull request Aug 11, 2024
* Add NodaTime and related packages.

* Configure NodaTime serialization.

* Remove RequiredNotNullableSchemaFilter.

* Update openapi.json.

* Configure JsonSerializerOptions for tests.

* Fix Instant example values.

* Choose an example ZonedDateTime.
TheTedder added a commit that referenced this pull request Aug 11, 2024
* Fix NodaTime Serialization (#216)

* Add NodaTime and related packages.

* Configure NodaTime serialization.

* Remove RequiredNotNullableSchemaFilter.

* Update openapi.json.

* Configure JsonSerializerOptions for tests.

* Fix Instant example values.

* Choose an example ZonedDateTime.

* Update Models (#217)

* Configure NodaTime serialization.

* Update openapi.json.

* Add CreatedAd, DeletedAt to run models.

* Add migrations for new Run properties.

* Add Run Info.

* Rename Leaderboard Rules to Info.

* Update Leaderboard comments.

* Fix RunViewModel formatting.

* Require all timestamps for RunViewModel.

* Add timestamp properties to Leaderboard.

* Add LB timestamps to DB schema.

* Rename Category Rules to Info.

* Remove unnecessary LB request defaults.

* Add Info to CreateLeaderboardRequest.

* Remove unnecessary default value.

* MAke CreateCategoryRequest.Info required.

* Use `required` keyword instead of attribute.

* Remove unnecessary JsonIgnore attribute.

* Include Info in Category equality check.

* Remove min and max player counts.

* Add timestamps to Category.

* Use Info when comparing Leaderboards.

* Add Category Sort Direction.

* Add EFCore.CheckConstraints package.

* Enable constraints.

* Remove Required attribute.

* Add DB constraints to LeaderBoard slugs.

* Fix bad Leaderboard slug regex.

* Use realistic test data.

* Add constraints to Category Slug.

* Add RunType enum.

* Add Category Type.

* Update Leaderboard GetHashCode()

* Update Category GetHashCode().

* Enable swagger inheriance and polymorphism.

* Add Run TimeOrScore.

* Use the default discriminator property name.

* Allow instantiation of RunViewModel.

* Load related Categories for Runs.

* Add computed Type property.

* Add explicit discriminator property to RunViewModel.

* Add computer Time property to Run.

* Use the default discriminator name.

* Add uniqueness constraint to Leaderboard Slug.

* Fix bad rebase.

* Make a Run belong to a User.

* Update openapi.json.

* Remove unnecessary JsonConverter Attribute.

* Add CreatedAt timestamp to User.

* Update registration tests.

* Add Type to CreateCategoryRequest.

* Add validation to CreateCategoryRequest.

* Create reusable slug validation.

* Create a unique index on Category Slug.

* Add CreateLeaderboardRequest Validation.

* Update CreateRunRequest.

* Remove unnecessary imports.

* Add a setter for Run Time.

* Disallow URL encoded characters in slugs.
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