Skip to content

Update info on rendering of C# data types to OpenAPI in .NET 10 #35222

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

Merged
merged 12 commits into from
Apr 17, 2025

Conversation

mikekistler
Copy link
Contributor

@mikekistler mikekistler commented Apr 14, 2025

This PR updates the information on how ASP.NET Core renders C# data types into OpenAPI schema in .NET 10.

This is a companion PR to #35214.


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/openapi/include-metadata.md aspnetcore/fundamentals/openapi/include-metadata

@mikekistler
Copy link
Contributor Author

@Rick-Anderson I pushed one new commit to update the information about how nullable properties appear in the OpenAPI doc, as this has also changed in .NET 10.

@Rick-Anderson
Copy link
Contributor

@Rick-Anderson I pushed one new commit to update the information about how nullable properties appear in the OpenAPI doc, as this has also changed in .NET 10.

d1f57a2 looks good. I'm fixing a couple build errors.

Comment on lines +548 to +554
| int | [integer,string] | int32 | pattern `<digits>` | pattern: `"^-?(?:0|[1-9]\\d*)$"`
| long | [integer,string] | int64 | pattern `<digits>` |
| short | [integer,string] | int16 | pattern `<digits>` |
| byte | [integer,string] | uint8 | pattern `<digits>` |
| float | [number,string] | float | pattern `<digits with decimal >` | pattern: `"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$"`
| double | [number,string] | double | pattern `<digits with decimal >` |
| decimal | [number,string] | double | pattern `<digits with decimal >` | pattern: `"^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"`
Copy link
Contributor

@Rick-Anderson Rick-Anderson Apr 15, 2025

Choose a reason for hiding this comment

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

@mikekistler
Took me awhile to figure that build error. See the | in the pattern? Even commented out, the parser picks up the column separator before stripping comment - error
even with ``` back ticks, same column error. Very strange

image

The other build error took a bit too, you had :: moniker-end, only two :, and 3 required. I've never made that mistake - every, because I'm dyslexic and can't type. I copy/paste.

Copy link
Contributor

Choose a reason for hiding this comment

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

@tdykstra @guardrex strange you can't have comments after a row that include a pipe | - even in a comment, even code fenced

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh @Rick-Anderson ... so sorry! I think I force-pushed and erased some of your changes by accident. I should have been more careful. I will try to recover.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay ... I think I restored your version. I will be more careful from now on.

Copy link
Contributor

@Rick-Anderson Rick-Anderson Apr 16, 2025

Choose a reason for hiding this comment

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

Oh @Rick-Anderson ... so sorry! I think I force-pushed and erased some of your changes by accident. I should have been more careful. I will try to recover.

I should have made clear I pushed some commits, sorry. I thought you were finished.

@mikekistler mikekistler force-pushed the mdk/dotnet10-openapi-metadata branch 2 times, most recently from 90c3421 to aaa5fe4 Compare April 16, 2025 00:23
@Rick-Anderson
Copy link
Contributor

@mikekistler merge when you're ready

@mikekistler mikekistler merged commit 07a5f4b into main Apr 17, 2025
4 checks passed
@mikekistler mikekistler deleted the mdk/dotnet10-openapi-metadata branch April 17, 2025 00:09
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