Is there an existing issue for this?
Describe the bug
When you write a SchemaTransformer which unwraps an object (e.g. OptionalValues) the first thing someone would use is Context.GetOrCreateSchemaAsync with the underlying type as it generates the schema for you and will give a schema which will be either inlined or nested depending on it's metadata. The inner schema which is genrated also goes to it's transformers. This is the cause of this issue.
A references B
B references A
What will happen with Circular references
- Transformer transforms A which wraps B
- Context.GetOrCreateSchemaAsync(B)
- B has a property of type A
- Transformer transforms A which wraps B
- Context.GetOrCreateSchemaAsync(B)
- B has a property of type A
- Transformer transforms A which wraps B
See for a repro/workaround desjoerd/OptionalValues#22
Expected Behavior
It should track that it's generating or transforming a type. And give a reference to it instead of going for the "Unresolved" schema.
Steps To Reproduce
See desjoerd/OptionalValues#22
It's hard to create a explainable reproduce.
Exceptions (if any)
No response
.NET Version
.NET 10 RC2
Anything else?
I would like to have a design session around Unresolved Schemas, resolved schemas and schema reference handling if possible, to squash this once and for all! 😊
Is there an existing issue for this?
Describe the bug
When you write a SchemaTransformer which unwraps an object (e.g. OptionalValues) the first thing someone would use is
Context.GetOrCreateSchemaAsyncwith the underlying type as it generates the schema for you and will give a schema which will be either inlined or nested depending on it's metadata. The inner schema which is genrated also goes to it's transformers. This is the cause of this issue.A references B
B references A
What will happen with Circular references
See for a repro/workaround desjoerd/OptionalValues#22
Expected Behavior
It should track that it's generating or transforming a type. And give a reference to it instead of going for the "Unresolved" schema.
Steps To Reproduce
See desjoerd/OptionalValues#22
It's hard to create a explainable reproduce.
Exceptions (if any)
No response
.NET Version
.NET 10 RC2
Anything else?
I would like to have a design session around Unresolved Schemas, resolved schemas and schema reference handling if possible, to squash this once and for all! 😊