René's URL Explorer Experiment


Title: Should SerializeV2WithoutReference resolve in object references as well? · LEGO/AsyncAPI.NET · Discussion #93 · GitHub

Open Graph Title: Should SerializeV2WithoutReference resolve in object references as well? · LEGO/AsyncAPI.NET · Discussion #93

X Title: Should SerializeV2WithoutReference resolve in object references as well? · LEGO/AsyncAPI.NET · Discussion #93

Description: Should SerializeV2WithoutReference resolve in object references as well?

Open Graph Description: 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 ...

X Description: 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 sch...

Opengraph URL: https://github.com/LEGO/AsyncAPI.NET/discussions/93

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Should SerializeV2WithoutReference resolve in object references as well?","text":"

Hi,

\n

SerializeV2WithoutReference currently only resolves top-level reference & uses internally SerializeV2 for properties of the AsyncApiSchema.

\n

In my use-case I am trying to extract payload schema to validate my de-serialized model in test against schema with JsonSchema package.
\nIn my tests I serialize and de-serialize my model, parse AsyncApi schema with this library and extract payload with SerializeV2WithoutReference.

\n

That results in JSON like this:

\n
{\n  \"type\": \"object\",\n  \"required\": [\n    \"testA\",\n  ],\n  \"properties\": {\n    \"testA\": {\n      \"type\": \"string\",\n      \"format\": \"uuid\"\n    },\n    \"testB\": {\n      \"$ref\": \"#/components/schemas/testB\"\n    }\n  }\n}\n
\n

testB is still unresolved so I would need to jump through hoops to actually use this JsonSchema to validate my serialized JSON.

\n

Is there any reason to not serialize completely without references, or some way to do that?
\nBonus questions, could this library go step further than just parsing AsyncApi schema and allow validation capacity same as JsonSchema does?

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Ive spent a bit more time on the issue, trying to streamline this a bit for the payload schemas.
\nAnyway.. I will make a PR that fixes this.

\n

With default settings you will get an output like this

\n
channels:\n  mychannel:\n    publish:\n      message:\n        payload:\n          type: object\n          required:\n            - testB\n          properties:\n            testC:\n              $ref: '#/components/schemas/testC'\n            testB:\n              $ref: '#/components/schemas/testB'\ncomponents:\n  schemas:\n    testD:\n      type: string\n      format: uuid\n    testC:\n      type: object\n      properties:\n        testD:\n          $ref: '#/components/schemas/testD'\n    testB:\n      type: boolean\n      description: test
\n

But if you instead use the inlinereferences setting

\n

like so

\n
var outputString = new StringWriter(CultureInfo.InvariantCulture);\nvar writer = new AsyncApiYamlWriter(outputString, new AsyncApiWriterSettings { ReferenceInline = ReferenceInlineSetting.InlineReferences });\nasyncApiDocument.SerializeV2(writer);
\n

you will get an output like the following

\n
channels:\n  mychannel:\n    publish:\n      message:\n        payload:\n          type: object\n          required:\n            - testB\n          properties:\n            testC:\n              type: object\n              properties:\n                testD:\n                  type: string\n                  format: uuid\n            testB:\n              type: boolean\n              description: test\ncomponents: { }
","upvoteCount":1,"url":"https://github.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289"}}}

route-pattern/_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format)
route-controllervoltron_discussions_fragments
route-actiondiscussion_layout
fetch-noncev2:4fea8092-5bd9-5d22-1fd3-1682934b4f31
current-catalog-service-hash9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be
request-id8400:315857:354C31:4A6C4B:6982151A
html-safe-nonce2cce8ba7ea33165ba410951b1c87f6e7eca266fa9a761ce47e70f5ad8d100398
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDAwOjMxNTg1NzozNTRDMzE6NEE2QzRCOjY5ODIxNTFBIiwidmlzaXRvcl9pZCI6IjY2ODA5OTY3NTI0NDU5ODU1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccfe7fad56479e2d67e0f8e94baecd7ac8edc2064940601c174e273c1ac0cf74f
hovercard-subject-tagdiscussion:4881222
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/discussions_fragments/discussion_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/LEGO/AsyncAPI.NET/93/discussion_layout
twitter:imagehttps://opengraph.githubassets.com/681490ed6e56d36e418729b938c8bed75aceec0ebc0a891cf2cc6d2c697fa78c/LEGO/AsyncAPI.NET/discussions/93
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/681490ed6e56d36e418729b938c8bed75aceec0ebc0a891cf2cc6d2c697fa78c/LEGO/AsyncAPI.NET/discussions/93
og:image:altHi, 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 ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonec5d01132ac10b0b45b88f4c1c8790502d669eb065ff383dc5e4757c174f3380f
turbo-cache-controlno-preview
go-importgithub.com/LEGO/AsyncAPI.NET git https://github.com/LEGO/AsyncAPI.NET.git
octolytics-dimension-user_id4530164
octolytics-dimension-user_loginLEGO
octolytics-dimension-repository_id442113220
octolytics-dimension-repository_nwoLEGO/AsyncAPI.NET
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id442113220
octolytics-dimension-repository_network_root_nwoLEGO/AsyncAPI.NET
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release0ac87bbde7c9f04b7ead5505c12f56048d89df09
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FLEGO%2FAsyncAPI.NET%2Fdiscussions%2F93
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FLEGO%2FAsyncAPI.NET%2Fdiscussions%2F93
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fdiscussions_fragments%2Fdiscussion_layout&source=header-repo&source_repo=LEGO%2FAsyncAPI.NET
Reloadhttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
Reloadhttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
Reloadhttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
LEGO https://patch-diff.githubusercontent.com/LEGO
AsyncAPI.NEThttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FLEGO%2FAsyncAPI.NET
Fork 18 https://patch-diff.githubusercontent.com/login?return_to=%2FLEGO%2FAsyncAPI.NET
Star 351 https://patch-diff.githubusercontent.com/login?return_to=%2FLEGO%2FAsyncAPI.NET
Code https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET
Issues 3 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/issues
Pull requests 1 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/pulls
Discussions https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions
Actions https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/actions
Wiki https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/wiki
Security 0 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/security
Insights https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/pulse
Code https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET
Issues https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/issues
Pull requests https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/pulls
Discussions https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions
Actions https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/actions
Wiki https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/wiki
Security https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/security
Insights https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/pulse
Answered https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289
VisualBeanhttps://patch-diff.githubusercontent.com/VisualBean
martinek-stepan https://patch-diff.githubusercontent.com/martinek-stepan
Q&Ahttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/categories/q-a
Should SerializeV2WithoutReference resolve in object references as well? https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#top
martinek-stepan https://patch-diff.githubusercontent.com/martinek-stepan
Answered https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289
VisualBeanhttps://patch-diff.githubusercontent.com/VisualBean
Return to tophttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#top
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
martinek-stepan https://patch-diff.githubusercontent.com/martinek-stepan
Feb 21, 2023 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussion-4881222
Give feedback.https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
VisualBean https://patch-diff.githubusercontent.com/VisualBean
Feb 22, 2023 https://github.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289
View full answer https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289
Oldest https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93?sort=old
Newest https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93?sort=new
Top https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93?sort=top
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
VisualBean https://patch-diff.githubusercontent.com/VisualBean
Feb 22, 2023 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074289
Give feedback.https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/martinek-stepan
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
martinek-stepanhttps://patch-diff.githubusercontent.com/martinek-stepan
Feb 22, 2023 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5074612
Give feedback.https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/VisualBean
Please reload this pagehttps://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
VisualBeanhttps://patch-diff.githubusercontent.com/VisualBean
Feb 22, 2023 https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93#discussioncomment-5075135
https://github.com/LEGO/AsyncAPI.NET/wiki/Reference-Resolutionhttps://github.com/LEGO/AsyncAPI.NET/wiki/Reference-Resolution
Give feedback.https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
martinek-stepanhttps://patch-diff.githubusercontent.com/martinek-stepan
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FLEGO%2FAsyncAPI.NET%2Fdiscussions%2F93
🙏 Q&A https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/categories/q-a
https://patch-diff.githubusercontent.com/martinek-stepan
https://patch-diff.githubusercontent.com/VisualBean
https://patch-diff.githubusercontent.com/LEGO/AsyncAPI.NET/discussions/93
https://patch-diff.githubusercontent.com/settings/replies?return_to=1
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.