-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
This is a meta issue and all code is in a single repo. I've done extensive work on code gen on the client side for OpenAPI and found these when I first tried converting and haven't had time to log this. Thanks for all the work you all put into this, would love to contribute back but spread really thin.
- HashSets doesn't generate correctly as it should include
"uniqueItems": true. See SampleModel.ShouldHaveUniqueItemsTrue prop. - long props are generated as
integer|stringtypes with a regex pattern. This should just be numeric, no regex. See SampleModel.ShouldNotHaveRegexPattern ([OpenAPI] integers have additional string type with pattern #61038 I think this covers it) - [Required] public required string ShouldHaveMinLength { get; init; } is marked as required but doens't have a
minlength. See SampleModel.ShouldNotHaveRegexPattern - Enums with
JsonStringEnumMemberNameare not handled. You have to specifically set[JsonConverter(typeof(StringEnumConverter))]. See StackStatusWithJsonStringEnumMemberName Maybe AddOpenApi not respectJsonSerializerOptionsConfigurations #59980 ? Either way this should be handled out of the box without needing a converter? - Version Props are missing the version pattern
"pattern": "^\\d+(\\.\\d+){1,3}$". See SampleModel.Version - Schemas is missing child types. For example I have CountResult which has a
Dictionary<string, IAggregate>. IAggregate is not genereated nor any derived types. - Enums are missing description, and
x-enumNames. See SampleModel.BillingStatus (OpenApi Enums generating no schema #58230 (comment)) kind of covers this, but not addressed andx-ms-enumis not an industry standard and should be removed (If it is included this way which it is not). /// <response code="404">The web hook could not be found.</response>are missing from the generated output. See [HttpGet("open-api-model-issue")]- Xml Documentation includes special new line characters that differ from previous versions. As such
<code>blocks render incorrectly in different user interfaces driven off the json. see[HttpPost("post-body-issue-and-comments-issue")] - No support for detecting which endpoints access Request.Body for streaming purposes. As such documentation is lacking. It should be assumed body is read if you have
[Consumes("application/json", "text/plain")] - Any type inside of
Task<ActionResult<WorkInProgressResult>>(e.g.,WorkInProgressResultis not included in the schema. See[HttpDelete("{ids}")]. I should not need[ProducesResponseType(typeof(WorkInProgressResult), StatusCodes.Status202Accepted)]. - Delta<> From OData days generates really weird. I don't have it included here but it generates a schema for each T in.. OData (e.g., DeltaOfUpdateUser) See (https://github.com/exceptionless/Exceptionless/blob/feature/net-10-upgrade-with-open-api-changes/src/Exceptionless.Web/Controllers/UserController.cs#L120)
- Not in the sample but
public ICollection<OAuthAccount> OAuthAccounts { get; } = new Collection<OAuthAccount>();should generatereadOnly: truebut does not. - I'm pretty sure I had to add
services.ConfigureHttpJsonOptionsto get somethings to work can't remember what but I think it for casing to be picked up forJsonPropertyNamein generation. This is weird and should just work if I haveservices.AddJsonOptions. - Please address System.Text.Json changes the data datatype from double to int on serialization runtime#35195.
Expected Behavior
These should just work out of the box.
Steps To Reproduce
Clone https://github.com/exceptionless/aspnet-core-net10-issues# and run it, hit the open api json endpoint.
Exceptions (if any)
No response
.NET Version
10 preview 4
Anything else?
MacOS Latest, Rider/VS Code
jankaltenecker
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi