Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
117 views
in Technique[技术] by (71.8m points)

c# - Using json schema from another repo

We have a common repo where all different projects share their common contract as json schemas. These schemas may be modified from time to time. How do I reference these schemas from inside my visual studio project without manually including their copies in my project?

Is it possible to wrap these schemas in a nuget package and include them?

question from:https://stackoverflow.com/questions/65930767/using-json-schema-from-another-repo

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Add the following to your JSON:

"$schema": "https://web.site/schema.json"

Obviously, change the URL. If your schema is on GitHub, open the file on the web in viewing mode, then click the "Raw" button.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...