Skip to content

Harden OpenAPI/GraphQL parsing and code generation#2

Merged
Theauxm merged 3 commits into
mainfrom
feat/openapi-parser-robustness
Mar 19, 2026
Merged

Harden OpenAPI/GraphQL parsing and code generation#2
Theauxm merged 3 commits into
mainfrom
feat/openapi-parser-robustness

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 19, 2026

Summary

  • Handle dotted/fully-qualified schema names (e.g. Namespace.Type), array component schemas, inline enums, and inline object arrays in OpenAPI parsing
  • Deduplicate operation names, resolve type/namespace collisions with fully-qualified refs, and treat non-fatal parse errors as warnings instead of hard failures
  • Add GraphQLNamespaces.sbn template for generating namespace constants, SimplifySchemaName/StripHttpVerbPrefix helpers, and description sanitization for multiline/escaped strings
  • Rewrite empty schema references to object to avoid HotChocolate zero-field type errors

Test plan

  • All 238 tests pass (includes new unit and integration tests for each edge case)
  • Build clean with zero warnings
  • Formatting verified with csharpier

Theauxm added 3 commits March 19, 2026 10:24
Handle dotted schema names, array component schemas, inline enums,
duplicate operation names, type/namespace collisions, and non-fatal
parse errors. Add GraphQLNamespaces.sbn template, SimplifySchemaName
and StripHttpVerbPrefix helpers, and description sanitization. Generate
fully-qualified type refs when names collide with namespace segments.
Operations with no input parameters now generate a dedicated empty
record (e.g. public record GetHealthInput;) instead of using
LanguageExt.Unit. This gives each train a unique input type for
mediator routing and avoids HotChocolate InputObjectType issues.
Directory.GetFiles ordering varies between Debug/Release builds.
Filter out I*Train.cs interface files to consistently get the
implementation file which contains the Description attribute.
@Theauxm Theauxm merged commit 301e9df into main Mar 19, 2026
1 check passed
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 19, 2026

This PR is included in version 1.2.0

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.

1 participant