Uh oh!
There was an error while loading. Please reload this page.
Should SerializeV2WithoutReference resolve in object references as well? #93
Hi, SerializeV2WithoutReference currently only resolves top-level reference & uses internally SerializeV2 for properties of the AsyncApiSchema. In my use-case I am trying to extract payload schema to validate my de-serialized model in test against schema with JsonSchema package. That results in JSON like this: testB is still unresolved so I would need to jump through hoops to actually use this JsonSchema to validate my serialized JSON. Is there any reason to not serialize completely without references, or some way to do that? |
Replies: 1 comment 2 replies
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ive spent a bit more time on the issue, trying to streamline this a bit for the payload schemas. With default settings you will get an output like this channels:
mychannel:
publish:
message:
payload:
type: objectrequired:
- testBproperties:
testC:
$ref: '#/components/schemas/testC'testB:
$ref: '#/components/schemas/testB'components:
schemas:
testD:
type: stringformat: uuidtestC:
type: objectproperties:
testD:
$ref: '#/components/schemas/testD'testB:
type: booleandescription: testBut if you instead use the inlinereferences setting like so varoutputString=newStringWriter(CultureInfo.InvariantCulture);varwriter=newAsyncApiYamlWriter(outputString,newAsyncApiWriterSettings{ReferenceInline=ReferenceInlineSetting.InlineReferences});asyncApiDocument.SerializeV2(writer);you will get an output like the following channels:
mychannel:
publish:
message:
payload:
type: objectrequired:
- testBproperties:
testC:
type: objectproperties:
testD:
type: stringformat: uuidtestB:
type: booleandescription: testcomponents: { } |
Ive spent a bit more time on the issue, trying to streamline this a bit for the payload schemas.
Anyway.. I will make a PR that fixes this.
With default settings you will get an output like this