{"success":true,"data":{"web":[{"url":"https://github.com/fabian-hiller/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","title":"JSON Schema - valibot - GitHub","description":"A large part of Valibot's schemas are JSON Schema compatible and can be easily converted to the JSON Schema format using the official toJsonSchema function.","position":1,"category":"github","markdown":"[Skip to content](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx#start-of-content)\n\nYou signed in with another tab or window. [Reload](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx) to refresh your session.Dismiss alert\n\n{{ message }}\n\n[open-circle](https://github.com/open-circle)/ **[valibot](https://github.com/open-circle/valibot)** Public\n\n- Sponsor\n\n\n\n\n\n\n\n# Sponsor open-circle/valibot\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##### GitHub Sponsors\n\n[Learn more about Sponsors](https://github.com/sponsors)\n\n\n\n\n\n\n\n\n\n[![@fabian-hiller](https://avatars.githubusercontent.com/u/35291865?s=80&v=4)](https://github.com/fabian-hiller)\n\n\n\n[fabian-hiller](https://github.com/fabian-hiller)\n\n\n\n[fabian-hiller](https://github.com/fabian-hiller)\n\n\n\n\n\n\n\n[Sponsor](https://github.com/sponsors/fabian-hiller)\n\n\n\n\n\n\n\n\n\n\n\n[![@EltonLobo07](https://avatars.githubusercontent.com/u/62232730?s=80&v=4)](https://github.com/EltonLobo07)\n\n\n\n[EltonLobo07](https://github.com/EltonLobo07)\n\n\n\n[EltonLobo07](https://github.com/EltonLobo07)\n\n\n\n\n\n\n\n[Sponsor](https://github.com/sponsors/EltonLobo07)\n\n\n\n\n\n\n\n\n\n\n\n[![@Bilboramix](https://avatars.githubusercontent.com/u/91626615?s=80&v=4)](https://github.com/Bilboramix)\n\n\n\n[Bilboramix](https://github.com/Bilboramix)\n\n\n\n[Bilboramix](https://github.com/Bilboramix)\n\n\n\n\n\n\n\n[Sponsor](https://github.com/sponsors/Bilboramix)\n\n\n\n\n\n\n\n\n\n\n\n##### External links\n\n\n\n\n\n![open_collective](https://github.githubassets.com/assets/open_collective-0a706523753d.svg)\n\n\n\n[opencollective.com/ **valibot**](https://opencollective.com/valibot)\n\n\n\n\n\n\n\n\n\n[Learn more about funding links in repositories](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository).\n\n\n\n\n[Report abuse](https://github.com/contact/report-abuse?report=open-circle%2Fvalibot+%28Repository+Funding+Links%29)\n\n- [Notifications](https://github.com/login?return_to=%2Fopen-circle%2Fvalibot) You must be signed in to change notification settings\n- [Fork\\\\\n314](https://github.com/login?return_to=%2Fopen-circle%2Fvalibot)\n- [Star\\\\\n8.5k](https://github.com/login?return_to=%2Fopen-circle%2Fvalibot)\n\n\n## Collapse file tree\n\n## Files\n\nmain\n\nSearch this repository(forward slash)` forward slash/`\n\n/\n\n# index.mdx\n\nCopy path\n\nBlameMore file actions\n\nBlameMore file actions\n\n## Latest commit\n\n[![fabian-hiller](https://avatars.githubusercontent.com/u/35291865?v=4&size=40)](https://github.com/fabian-hiller)[fabian-hiller](https://github.com/open-circle/valibot/commits?author=fabian-hiller)\n\n[Add custom Link component to disabled prefetching globally](https://github.com/open-circle/valibot/commit/2ee9767b9bfef44e958e148623882c890090deb0)\n\nsuccess\n\n4 months agoNov 23, 2025\n\n[2ee9767](https://github.com/open-circle/valibot/commit/2ee9767b9bfef44e958e148623882c890090deb0) · 4 months agoNov 23, 2025\n\n## History\n\n[History](https://github.com/open-circle/valibot/commits/main/website/src/routes/guides/(advanced)/json-schema/index.mdx)\n\nOpen commit details\n\n[View commit history for this file.](https://github.com/open-circle/valibot/commits/main/website/src/routes/guides/(advanced)/json-schema/index.mdx) History\n\n39 lines (25 loc) · 2.53 KB\n\n/\n\n# index.mdx\n\nTop\n\n## File metadata and controls\n\n- Preview\n\n- Code\n\n- Blame\n\n\n39 lines (25 loc) · 2.53 KB\n\n[Raw](https://github.com/open-circle/valibot/raw/refs/heads/main/website/src/routes/guides/(advanced)/json-schema/index.mdx)\n\nCopy raw file\n\nDownload raw file\n\nOutline\n\nEdit and raw actions\n\n| title | JSON Schema |\n| description | This guide will show you how to convert Valibot schemas to JSON Schema format. |\n| contributors | | |\n| --- |\n| fabian-hiller | |\n\nimport { Link } from '~/components';\n\n# JSON Schema\n\n[Permalink: JSON Schema](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx#json-schema)\n\nIn favor of a larger feature set and smaller bundle size, Valibot is not implemented with JSON Schema in mind. However, in some use cases, you may still need a JSON Schema. This guide will show you how to convert Valibot schemas to JSON Schema format.\n\n## Valibot to JSON Schema\n\n[Permalink: Valibot to JSON Schema](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx#valibot-to-json-schema)\n\nA large part of Valibot's schemas are JSON Schema compatible and can be easily converted to the JSON Schema format using the official `toJsonSchema` function. This function is provided via a separate package called [`@valibot/to-json-schema`](https://github.com/open-circle/valibot/tree/main/packages/to-json-schema).\n\n> See the [README](https://github.com/open-circle/valibot/blob/main/packages/to-json-schema/README.md) of the `@valibot/to-json-schema` package for more details. It is also recommended that you take a look at this blog post, which highlights recent improvements.\n\n```\nimport { toJsonSchema } from '@valibot/to-json-schema';\nimport * as v from 'valibot';\n\nconst ValibotEmailSchema = v.pipe(v.string(), v.email());\nconst JsonEmailSchema = toJsonSchema(ValibotEmailSchema);\n// -> { type: 'string', format: 'email' }\n```\n\n## Cons of JSON Schema\n\n[Permalink: Cons of JSON Schema](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx#cons-of-json-schema)\n\nValibot schemas intentionally do not output JSON Schema natively. This is because JSON Schema is limited to JSON-compliant data structures. In addition, more advanced features like transformations are not supported. Since we want to leverage the full power of TypeScript, we output a custom format instead.\n\nAnother drawback of JSON Schema is that JSON Schema itself does not contain any validation logic. Therefore, an additional function is required that can validate the entire JSON Schema specification. This approach is usually not tree-shakable and results in a large bundle size.\n\nIn contrast, Valibot's API design and implementation is completely modular. Every schema is independent and contains its own validation logic. This allows the schemas to be plugged together like LEGO bricks, resulting in a much smaller bundle size due to tree shaking.\n\n## Pros of JSON Schema\n\n[Permalink: Pros of JSON Schema](https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx#pros-of-json-schema)\n\nDespite these drawbacks, JSON Schema is still widely used in the industry because it also has many advantages. For example, JSON Schemas can be used across programming languages and tools. In addition, JSON Schemas are serializable and can be easily stored in a database or transmitted over a network.\n\nYou can’t perform that action at this time.","metadata":{"viewport":"width=device-width","user-login":"","turbo-body-classes":"logged-out env-production page-responsive","octolytics-dimension-repository_is_fork":"false","title":"valibot/website/src/routes/guides/(advanced)/json-schema/index.mdx at main · open-circle/valibot · GitHub","octolytics-dimension-user_id":"162486767","analytics-location":"///blob/show","github-keyboard-shortcuts":"repository,source-code,file-tree,copilot","twitter:card":"summary_large_image","go-import":"github.com/open-circle/valibot git https://github.com/open-circle/valibot.git","og:description":"The modular and type safe schema library for validating structural data 🤖 - open-circle/valibot","fb:app_id":"1401488693436528","visitor-hmac":"859747981b8a37ac80a896f500e36c22fb5c7bbf6573a144fba9d874a98b64cd","og:type":"object","ogSiteName":"GitHub","theme-color":"#1e2327","octolytics-url":"https://collector.github.com/github/collect","route-action":"show","ogTitle":"valibot/website/src/routes/guides/(advanced)/json-schema/index.mdx at main · open-circle/valibot","browser-errors-url":"https://api.github.com/_private/browser/errors","browser-stats-url":"https://api.github.com/_private/browser/stats","octolytics-dimension-repository_nwo":"open-circle/valibot","google-site-verification":"Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I","route-pattern":"/:user_id/:repository/blob/*name(/*path)","ui-target":"full","route-controller":"blob","ogDescription":"The modular and type safe schema library for validating structural data 🤖 - open-circle/valibot","og:site_name":"GitHub","turbo-cache-control":["no-preview","no-cache"],"ogImage":"https://repository-images.githubusercontent.com/663456281/04454e2b-8e89-4bbc-8b6e-518d1f01f7b5","twitter:image":"https://repository-images.githubusercontent.com/663456281/04454e2b-8e89-4bbc-8b6e-518d1f01f7b5","language":"en","twitter:title":"valibot/website/src/routes/guides/(advanced)/json-schema/index.mdx at main · open-circle/valibot","description":"The modular and type safe schema library for validating structural data 🤖 - valibot/website/src/routes/guides/(advanced)/json-schema/index.mdx at main · open-circle/valibot","expected-hostname":"github.com","octolytics-dimension-repository_network_root_nwo":"open-circle/valibot","apple-itunes-app":"app-id=1477376905, app-argument=https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","request-id":"823B:A09C:41DB5B8:542F6DB:69C90C4F","color-scheme":"light dark","release":"51d2e33e3d1e4839c3ced5f8e35c7a47d3a60f32","og:image:alt":"The modular and type safe schema library for validating structural data 🤖 - open-circle/valibot","twitter:site":"@github","octolytics-dimension-user_login":"open-circle","visitor-payload":"eyJyZWZlcnJlciI6Imh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vIiwicmVxdWVzdF9pZCI6IjgyM0I6QTA5Qzo0MURCNUI4OjU0MkY2REI6NjlDOTBDNEYiLCJ2aXNpdG9yX2lkIjoiMjIxODM5ODA2OTU0NzQwNDM2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9","html-safe-nonce":"04aa86ef922e154c2bd980f0c7a99b4d2938c33604108d4abc1a87511d525c0f","fetch-nonce":"v2:a5058338-1c9e-c39a-6f5c-11c23b08a900","hovercard-subject-tag":"repository:663456281","og:title":"valibot/website/src/routes/guides/(advanced)/json-schema/index.mdx at main · open-circle/valibot","og:image":"https://repository-images.githubusercontent.com/663456281/04454e2b-8e89-4bbc-8b6e-518d1f01f7b5","hostname":"github.com","octolytics-dimension-repository_public":"true","octolytics-dimension-repository_network_root_id":"663456281","disable-turbo":"false","octolytics-dimension-repository_id":"663456281","current-catalog-service-hash":"f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb","twitter:description":"The modular and type safe schema library for validating structural data 🤖 - open-circle/valibot","og:url":"https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","ogUrl":"https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","favicon":"https://github.githubassets.com/favicons/favicon.svg","scrapeId":"019d3958-1419-7318-bb37-40107a8ff683","sourceURL":"https://github.com/fabian-hiller/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","url":"https://github.com/open-circle/valibot/blob/main/website/src/routes/guides/(advanced)/json-schema/index.mdx","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"b5ee1653-aedd-47d1-a685-463e51649867","creditsUsed":1}},{"url":"https://github.com/RicoSuter/NJsonSchema","title":"GitHub - RicoSuter/NJsonSchema: JSON Schema reader, generator ...","description":"NJsonSchema is a .NET library to read, generate and validate JSON Schema draft v4+ schemas. The library can read a schema from a file or string and validate ...","position":2,"category":"github","markdown":"[Skip to content](https://github.com/RicoSuter/NJsonSchema#start-of-content)\n\nYou signed in with another tab or window. [Reload](https://github.com/RicoSuter/NJsonSchema) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/RicoSuter/NJsonSchema) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/RicoSuter/NJsonSchema) to refresh your session.Dismiss alert\n\n{{ message }}\n\n[RicoSuter](https://github.com/RicoSuter)/ **[NJsonSchema](https://github.com/RicoSuter/NJsonSchema)** Public\n\n- [Sponsor](https://github.com/sponsors/RicoSuter)\n- [Notifications](https://github.com/login?return_to=%2FRicoSuter%2FNJsonSchema) You must be signed in to change notification settings\n- [Fork\\\\\n548](https://github.com/login?return_to=%2FRicoSuter%2FNJsonSchema)\n- [Star\\\\\n1.6k](https://github.com/login?return_to=%2FRicoSuter%2FNJsonSchema)\n\n\nmaster\n\n[**51** Branches](https://github.com/RicoSuter/NJsonSchema/branches) [**1216** Tags](https://github.com/RicoSuter/NJsonSchema/tags)\n\n[Go to Branches page](https://github.com/RicoSuter/NJsonSchema/branches)[Go to Tags page](https://github.com/RicoSuter/NJsonSchema/tags)\n\nGo to file\n\nCode\n\nOpen more actions menu\n\n## Folders and files\n\n| Name | Name | Last commit message | Last commit date |\n| --- | --- | --- | --- |\n| ## Latest commit
![lahma](https://avatars.githubusercontent.com/u/171892?v=4&size=40)![claude](https://avatars.githubusercontent.com/u/81847?v=4&size=40)
[lahma](https://github.com/RicoSuter/NJsonSchema/commits?author=lahma)
and
[claude](https://github.com/RicoSuter/NJsonSchema/commits?author=claude)
[Fix IPv4 format validator regex false positives (](https://github.com/RicoSuter/NJsonSchema/commit/7424d6c0d57867c8aab214753c34b18c3c3e1411) [#1909](https://github.com/RicoSuter/NJsonSchema/pull/1909) [)](https://github.com/RicoSuter/NJsonSchema/commit/7424d6c0d57867c8aab214753c34b18c3c3e1411)
Open commit detailssuccess
3 weeks agoMar 9, 2026
[7424d6c](https://github.com/RicoSuter/NJsonSchema/commit/7424d6c0d57867c8aab214753c34b18c3c3e1411) · 3 weeks agoMar 9, 2026
## History
[3,089 Commits](https://github.com/RicoSuter/NJsonSchema/commits/master/)
Open commit details
[View commit history for this file.](https://github.com/RicoSuter/NJsonSchema/commits/master/) 3,089 Commits |\n| [.github](https://github.com/RicoSuter/NJsonSchema/tree/master/.github \".github\") | [.github](https://github.com/RicoSuter/NJsonSchema/tree/master/.github \".github\") | [Upgrade to NUKE 10.1.0 (](https://github.com/RicoSuter/NJsonSchema/commit/6d3580c03079107bacf8869e5e64df7feb138cd9 \"Upgrade to NUKE 10.1.0 (#1877)\") [#1877](https://github.com/RicoSuter/NJsonSchema/pull/1877) [)](https://github.com/RicoSuter/NJsonSchema/commit/6d3580c03079107bacf8869e5e64df7feb138cd9 \"Upgrade to NUKE 10.1.0 (#1877)\") | 3 months agoDec 7, 2025 |\n| [.nuke](https://github.com/RicoSuter/NJsonSchema/tree/master/.nuke \".nuke\") | [.nuke](https://github.com/RicoSuter/NJsonSchema/tree/master/.nuke \".nuke\") | [Upgrade to NUKE 8.1 (](https://github.com/RicoSuter/NJsonSchema/commit/0bfadbb24850aa4d9e0728076b39e28128f57caf \"Upgrade to NUKE 8.1 (#1731)\") [#1731](https://github.com/RicoSuter/NJsonSchema/pull/1731) [)](https://github.com/RicoSuter/NJsonSchema/commit/0bfadbb24850aa4d9e0728076b39e28128f57caf \"Upgrade to NUKE 8.1 (#1731)\") | 2 years agoNov 19, 2024 |\n| [assets](https://github.com/RicoSuter/NJsonSchema/tree/master/assets \"assets\") | [assets](https://github.com/RicoSuter/NJsonSchema/tree/master/assets \"assets\") | [Modified icons](https://github.com/RicoSuter/NJsonSchema/commit/8f6449d34e01d1a264ec46fd32ab257c077757a5 \"Modified icons\") | 9 years agoNov 5, 2017 |\n| [build](https://github.com/RicoSuter/NJsonSchema/tree/master/build \"build\") | [build](https://github.com/RicoSuter/NJsonSchema/tree/master/build \"build\") | [Upgrade to NUKE 10.1.0 (](https://github.com/RicoSuter/NJsonSchema/commit/6d3580c03079107bacf8869e5e64df7feb138cd9 \"Upgrade to NUKE 10.1.0 (#1877)\") [#1877](https://github.com/RicoSuter/NJsonSchema/pull/1877) [)](https://github.com/RicoSuter/NJsonSchema/commit/6d3580c03079107bacf8869e5e64df7feb138cd9 \"Upgrade to NUKE 10.1.0 (#1877)\") | 3 months agoDec 7, 2025 |\n| [src](https://github.com/RicoSuter/NJsonSchema/tree/master/src \"src\") | [src](https://github.com/RicoSuter/NJsonSchema/tree/master/src \"src\") | [Fix IPv4 format validator regex false positives (](https://github.com/RicoSuter/NJsonSchema/commit/7424d6c0d57867c8aab214753c34b18c3c3e1411 \"Fix IPv4 format validator regex false positives (#1909) Escape dot character in regex to match literal dots only, preventing strings like '00:45:00.0' from passing validation. Co-authored-by: Claude Opus 4.6 \") [#1909](https://github.com/RicoSuter/NJsonSchema/pull/1909) [)](https://github.com/RicoSuter/NJsonSchema/commit/7424d6c0d57867c8aab214753c34b18c3c3e1411 \"Fix IPv4 format validator regex false positives (#1909) Escape dot character in regex to match literal dots only, preventing strings like '00:45:00.0' from passing validation. Co-authored-by: Claude Opus 4.6 \") | 3 weeks agoMar 9, 2026 |\n| [.gitattributes](https://github.com/RicoSuter/NJsonSchema/blob/master/.gitattributes \".gitattributes\") | [.gitattributes](https://github.com/RicoSuter/NJsonSchema/blob/master/.gitattributes \".gitattributes\") | [Convert to xUnit v3 (](https://github.com/RicoSuter/NJsonSchema/commit/0e075ecdc1b29d4589c2a3df82875623597dc5a7 \"Convert to xUnit v3 (#1848)\") [#1848](https://github.com/RicoSuter/NJsonSchema/pull/1848) [)](https://github.com/RicoSuter/NJsonSchema/commit/0e075ecdc1b29d4589c2a3df82875623597dc5a7 \"Convert to xUnit v3 (#1848)\") | 8 months agoJul 28, 2025 |\n| [.gitignore](https://github.com/RicoSuter/NJsonSchema/blob/master/.gitignore \".gitignore\") | [.gitignore](https://github.com/RicoSuter/NJsonSchema/blob/master/.gitignore \".gitignore\") | [Convert to xUnit v3 (](https://github.com/RicoSuter/NJsonSchema/commit/0e075ecdc1b29d4589c2a3df82875623597dc5a7 \"Convert to xUnit v3 (#1848)\") [#1848](https://github.com/RicoSuter/NJsonSchema/pull/1848) [)](https://github.com/RicoSuter/NJsonSchema/commit/0e075ecdc1b29d4589c2a3df82875623597dc5a7 \"Convert to xUnit v3 (#1848)\") | 8 months agoJul 28, 2025 |\n| [CONTRIBUTING.md](https://github.com/RicoSuter/NJsonSchema/blob/master/CONTRIBUTING.md \"CONTRIBUTING.md\") | [CONTRIBUTING.md](https://github.com/RicoSuter/NJsonSchema/blob/master/CONTRIBUTING.md \"CONTRIBUTING.md\") | [Changed license to MIT,](https://github.com/RicoSuter/NJsonSchema/commit/6798a34c8b76632a93aa36f7f9b9c1cca94e026e \"Changed license to MIT, closes #178\") [closes](https://github.com/RicoSuter/NJsonSchema/commit/6798a34c8b76632a93aa36f7f9b9c1cca94e026e \"Changed license to MIT, closes #178\") [#178](https://github.com/RicoSuter/NJsonSchema/issues/178) | 10 years agoNov 30, 2016 |\n| [Directory.Build.props](https://github.com/RicoSuter/NJsonSchema/blob/master/Directory.Build.props \"Directory.Build.props\") | [Directory.Build.props](https://github.com/RicoSuter/NJsonSchema/blob/master/Directory.Build.props \"Directory.Build.props\") | [Include root README.md in all NuGet packages (](https://github.com/RicoSuter/NJsonSchema/commit/dad32363b55119b6bae9171c33316248d7b6d711 \"Include root README.md in all NuGet packages (#1885) * Initial plan * Add PackageReadmeFile to include README.md in all NuGet packages Co-authored-by: lahma <171892+lahma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lahma <171892+lahma@users.noreply.github.com>\") [#1885](https://github.com/RicoSuter/NJsonSchema/pull/1885) [)](https://github.com/RicoSuter/NJsonSchema/commit/dad32363b55119b6bae9171c33316248d7b6d711 \"Include root README.md in all NuGet packages (#1885) * Initial plan * Add PackageReadmeFile to include README.md in all NuGet packages Co-authored-by: lahma <171892+lahma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lahma <171892+lahma@users.noreply.github.com>\") | 28 days agoMar 1, 2026 |\n| [Directory.Packages.props](https://github.com/RicoSuter/NJsonSchema/blob/master/Directory.Packages.props \"Directory.Packages.props\") | [Directory.Packages.props](https://github.com/RicoSuter/NJsonSchema/blob/master/Directory.Packages.props \"Directory.Packages.props\") | [Update dependencies (](https://github.com/RicoSuter/NJsonSchema/commit/f55027b93c099a1ec6b4fb02cf428b733a044c6e \"Update dependencies (#1874) * BenchmarkDotNet 0.15.4 * Fluid.Core 2.30.0 * Microsoft.NET.Test.Sdk 18.0.0 * Verify.XunitV3 31.0.4 * xunit.v3 3.1.0 * xunit.runner.visualstudio 3.1.5\") [#1874](https://github.com/RicoSuter/NJsonSchema/pull/1874) [)](https://github.com/RicoSuter/NJsonSchema/commit/f55027b93c099a1ec6b4fb02cf428b733a044c6e \"Update dependencies (#1874) * BenchmarkDotNet 0.15.4 * Fluid.Core 2.30.0 * Microsoft.NET.Test.Sdk 18.0.0 * Verify.XunitV3 31.0.4 * xunit.v3 3.1.0 * xunit.runner.visualstudio 3.1.5\") | 5 months agoOct 25, 2025 |\n| [LICENSE.md](https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md \"LICENSE.md\") | [LICENSE.md](https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md \"LICENSE.md\") | [Nothing has changed but git reports these files as modified](https://github.com/RicoSuter/NJsonSchema/commit/1367c8bc8eeddf9ab452a6800a4e4383a4016a43 \"Nothing has changed but git reports these files as modified\") | 9 years agoJun 26, 2017 |\n| [README.md](https://github.com/RicoSuter/NJsonSchema/blob/master/README.md \"README.md\") | [README.md](https://github.com/RicoSuter/NJsonSchema/blob/master/README.md \"README.md\") | [Fix outdated JSON schema output example in README (](https://github.com/RicoSuter/NJsonSchema/commit/29ff773e3893ac678849faa32e8d9eaf61f85950 \"Fix outdated JSON schema output example in README (#1887) * Initial plan * Update README.md JSON output to match current API behavior Co-authored-by: lahma <171892+lahma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lahma <171892+lahma@users.noreply.github.com>\") [#1887](https://github.com/RicoSuter/NJsonSchema/pull/1887) [)](https://github.com/RicoSuter/NJsonSchema/commit/29ff773e3893ac678849faa32e8d9eaf61f85950 \"Fix outdated JSON schema output example in README (#1887) * Initial plan * Update README.md JSON output to match current API behavior Co-authored-by: lahma <171892+lahma@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lahma <171892+lahma@users.noreply.github.com>\") | 28 days agoMar 1, 2026 |\n| [build.cmd](https://github.com/RicoSuter/NJsonSchema/blob/master/build.cmd \"build.cmd\") | [build.cmd](https://github.com/RicoSuter/NJsonSchema/blob/master/build.cmd \"build.cmd\") | [Add NUKE build and GitHub Actions (](https://github.com/RicoSuter/NJsonSchema/commit/f3ef6be85bd65509abe5b50a44b113866a56496b \"Add NUKE build and GitHub Actions (#1446) * Add NUKE build * switch from .NET 5 to .NET 6 * fix line ending handling for Linux build * Add Publish target to build * Remove YAML pipeline (Azure DevOps) * Update sln * Remove azure-pipelines.yml from sln * Update sln with props * Rename folder * Remove nuke from branches Co-authored-by: Rico Suter \") [#1446](https://github.com/RicoSuter/NJsonSchema/pull/1446) [)](https://github.com/RicoSuter/NJsonSchema/commit/f3ef6be85bd65509abe5b50a44b113866a56496b \"Add NUKE build and GitHub Actions (#1446) * Add NUKE build * switch from .NET 5 to .NET 6 * fix line ending handling for Linux build * Add Publish target to build * Remove YAML pipeline (Azure DevOps) * Update sln * Remove azure-pipelines.yml from sln * Update sln with props * Rename folder * Remove nuke from branches Co-authored-by: Rico Suter \") | 5 years agoNov 22, 2021 |\n| [build.ps1](https://github.com/RicoSuter/NJsonSchema/blob/master/build.ps1 \"build.ps1\") | [build.ps1](https://github.com/RicoSuter/NJsonSchema/blob/master/build.ps1 \"build.ps1\") | [Upgrade to NUKE 8 (](https://github.com/RicoSuter/NJsonSchema/commit/621f3f2dfcf99252351c3152946901664ac1f799 \"Upgrade to NUKE 8 (#1669)\") [#1669](https://github.com/RicoSuter/NJsonSchema/pull/1669) [)](https://github.com/RicoSuter/NJsonSchema/commit/621f3f2dfcf99252351c3152946901664ac1f799 \"Upgrade to NUKE 8 (#1669)\") | 2 years agoJul 17, 2024 |\n| [build.sh](https://github.com/RicoSuter/NJsonSchema/blob/master/build.sh \"build.sh\") | [build.sh](https://github.com/RicoSuter/NJsonSchema/blob/master/build.sh \"build.sh\") | [Upgrade to NUKE 8 (](https://github.com/RicoSuter/NJsonSchema/commit/621f3f2dfcf99252351c3152946901664ac1f799 \"Upgrade to NUKE 8 (#1669)\") [#1669](https://github.com/RicoSuter/NJsonSchema/pull/1669) [)](https://github.com/RicoSuter/NJsonSchema/commit/621f3f2dfcf99252351c3152946901664ac1f799 \"Upgrade to NUKE 8 (#1669)\") | 2 years agoJul 17, 2024 |\n| [global.json](https://github.com/RicoSuter/NJsonSchema/blob/master/global.json \"global.json\") | [global.json](https://github.com/RicoSuter/NJsonSchema/blob/master/global.json \"global.json\") | [Use NET 10 SDK and upgrade to NUKE 10 (](https://github.com/RicoSuter/NJsonSchema/commit/3e5a5633a95b0e7d4be549abd102b96ca6afb96c \"Use NET 10 SDK and upgrade to NUKE 10 (#1876)\") [#1876](https://github.com/RicoSuter/NJsonSchema/pull/1876) [)](https://github.com/RicoSuter/NJsonSchema/commit/3e5a5633a95b0e7d4be549abd102b96ca6afb96c \"Use NET 10 SDK and upgrade to NUKE 10 (#1876)\") | 4 months agoNov 27, 2025 |\n| View all files |\n\n## Repository files navigation\n\n# NJsonSchema for .NET\n\n[Permalink: NJsonSchema for .NET](https://github.com/RicoSuter/NJsonSchema#njsonschema-for-net)\n\n[NSwag](http://nswag.org/) \\| NJsonSchema \\| [Apimundo](https://apimundo.com/) \\| [Namotion.Reflection](https://github.com/RicoSuter/Namotion.Reflection)\n\n[![Azure DevOps](https://camo.githubusercontent.com/0736663db9721a4f86f164f0ba27167e38f45f4f48e119dc760e100ad12b79c3/68747470733a2f2f696d672e736869656c64732e696f2f617a7572652d6465766f70732f6275696c642f7273757465722f4e4a736f6e536368656d612f31372f6d61737465722e737667)](https://rsuter.visualstudio.com/NJsonSchema/_build?definitionId=17)[![Nuget](https://camo.githubusercontent.com/569de4154e940e0ab08b5d1a7b729ce3406b46ed39c017e273bd2cea7a566709/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f4e4a736f6e536368656d612e737667)](https://www.nuget.org/packages?q=NJsonSchema)[![Discord](https://camo.githubusercontent.com/2c7116bfef4cc459b533dffc11e6926eebd0b8dd60c148d47d2541be8417c5dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446973636f72642d6a6f696e253230636861742d3164636537332e737667)](https://discord.gg/BxQNy25WF6)[![StackOverflow](https://camo.githubusercontent.com/a03b874398057fc27fcf7625e4b76376ebbd07d7d565a98db21b02b16dc27bab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7175657374696f6e732d6f6e253230537461636b4f766572666c6f772d6f72616e67652e7376673f7374796c653d666c6174)](http://stackoverflow.com/questions/tagged/njsonschema)[![Wiki](https://camo.githubusercontent.com/1b1062876c546ede673a29e46ffcd6af93c7072904aa05b4172c90b2c5692816/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d696e25323077696b692d6f72616e67652e7376673f7374796c653d666c6174)](https://github.com/RicoSuter/njsonschema/wiki)[![Apimundo](https://camo.githubusercontent.com/d7f906ed35c7f5b3d435cba4092fba4498ea1e979c667f65379b912d06d50509/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4172636869746563747572652d4170696d756e646f2d3732383139392e737667)](https://apimundo.com/organizations/github/projects/ricosuter?tab=repositories)\n\n![](https://raw.githubusercontent.com/RSuter/NJsonSchema/master/assets/GitHubIcon.png)\n\nNJsonSchema is a .NET library to read, generate and validate JSON Schema draft v4+ schemas. The library can read a schema from a file or string and validate JSON data against it. A schema can also be generated from an existing .NET class. With the code generation APIs you can generate C# and TypeScript classes or interfaces from a schema.\n\nThe library uses [Json.NET](http://james.newtonking.com/json) to read and write JSON data and [Namotion.Reflection](https://github.com/RicoSuter/Namotion.Reflection) for additional .NET reflection APIs.\n\n**NuGet packages:**\n\n- [NJsonSchema](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema/versions/latest) : JSON Schema parsing, validation and generation classes\n- [NJsonSchema.Annotations](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema.Annotations/versions/latest) : JSON Schema annotations controlling serialization\n- [NJsonSchema.Yaml](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema.Yaml/versions/latest) : Read and write JSON Schemas from YAML\n- [NJsonSchema.CodeGeneration](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema.CodeGeneration/versions/latest) : Base classes to generate code from a JSON Schema\n- [NJsonSchema.CodeGeneration.CSharp](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema.CodeGeneration.CSharp/versions/latest) : Generates CSharp classes\n- [NJsonSchema.CodeGeneration.TypeScript](https://apimundo.com/organizations/nuget-org/nuget-feeds/public/packages/NJsonSchema.CodeGeneration.TypeScript/versions/latest) : Generates TypeScript interfaces or classes\n\nPreview NuGet Feed: [https://www.myget.org/F/njsonschema/api/v3/index.json](https://www.myget.org/F/njsonschema/api/v3/index.json)\n\n**Features:**\n\n- [Read existing JSON Schemas](https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchema) and [validate JSON data](https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaValidator) (`JsonSchema.FromJsonAsync()`)\n- [Generate JSON Schema from .NET type via reflection](https://github.com/RicoSuter/NJsonSchema/wiki/JsonSchemaGenerator) (with support for many attributes/annotations) (`JsonSchema.FromType()`)\n- [Generate JSON Schema from sample JSON data](https://github.com/RicoSuter/NJsonSchema/wiki/SampleJsonSchemaGenerator) (`JsonSchema.FromSampleJson()`)\n- Support for schema references ($ref) (relative, URL and file)\n- Generate C# and TypeScript code from JSON Schema\n- Supports .NET Standard 2.0, also see [XML Documentation](https://github.com/NJsonSchema/NJsonSchema/wiki/XML-Documentation))\n- Supports JSON Schema, Swagger and OpenAPI DTO schemas\n\nNJsonSchema is heavily used in [NSwag](http://nswag.org/), a Swagger API toolchain for .NET which generates client code for Web API services. NSwag also provides command line tools to use the NJsonSchema's JSON Schema generator (command `types2swagger`).\n\nThe project is developed and maintained by [Rico Suter](http://rsuter.com/) and other contributors.\n\n**Some code generators can directly be used via the [Apimundo service](https://apimundo.com/tools).**\n\n## NJsonSchema usage\n\n[Permalink: NJsonSchema usage](https://github.com/RicoSuter/NJsonSchema#njsonschema-usage)\n\nThe [JsonSchema](https://github.com/NJsonSchema/NJsonSchema/wiki/JsonSchema) class can be used as follows:\n\n```\nvar schema = JsonSchema.FromType();\nvar schemaData = schema.ToJson();\nvar errors = schema.Validate(\"{...}\");\n\nforeach (var error in errors)\n Console.WriteLine(error.Path + \": \" + error.Kind);\n\nschema = await JsonSchema.FromJsonAsync(schemaData);\n```\n\nThe `Person` class:\n\n```\npublic class Person\n{\n [Required]\n public string FirstName { get; set; }\n\n public string MiddleName { get; set; }\n\n [Required]\n public string LastName { get; set; }\n\n public Gender Gender { get; set; }\n\n [Range(2, 5)]\n public int NumberWithRange { get; set; }\n\n public DateTime Birthday { get; set; }\n\n public Company Company { get; set; }\n\n public Collection Cars { get; set; }\n}\n\npublic enum Gender\n{\n Male,\n Female\n}\n\npublic class Car\n{\n public string Name { get; set; }\n\n public Company Manufacturer { get; set; }\n}\n\npublic class Company\n{\n public string Name { get; set; }\n}\n```\n\nThe generated JSON schema data stored in the `schemaData` variable:\n\n```\n{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\": \"Person\",\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"required\": [\\\n \"FirstName\",\\\n \"LastName\"\\\n ],\n \"properties\": {\n \"FirstName\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"MiddleName\": {\n \"type\": [\\\n \"null\",\\\n \"string\"\\\n ]\n },\n \"LastName\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"Gender\": {\n \"$ref\": \"#/definitions/Gender\"\n },\n \"NumberWithRange\": {\n \"type\": \"integer\",\n \"format\": \"int32\",\n \"maximum\": 5.0,\n \"minimum\": 2.0\n },\n \"Birthday\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"Company\": {\n \"oneOf\": [\\\n {\\\n \"type\": \"null\"\\\n },\\\n {\\\n \"$ref\": \"#/definitions/Company\"\\\n }\\\n ]\n },\n \"Cars\": {\n \"type\": [\\\n \"array\",\\\n \"null\"\\\n ],\n \"items\": {\n \"$ref\": \"#/definitions/Car\"\n }\n }\n },\n \"definitions\": {\n \"Gender\": {\n \"type\": \"integer\",\n \"description\": \"\",\n \"x-enumNames\": [\\\n \"Male\",\\\n \"Female\"\\\n ],\n \"enum\": [\\\n 0,\\\n 1\\\n ]\n },\n \"Company\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"Name\": {\n \"type\": [\\\n \"null\",\\\n \"string\"\\\n ]\n }\n }\n },\n \"Car\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"Name\": {\n \"type\": [\\\n \"null\",\\\n \"string\"\\\n ]\n },\n \"Manufacturer\": {\n \"oneOf\": [\\\n {\\\n \"type\": \"null\"\\\n },\\\n {\\\n \"$ref\": \"#/definitions/Company\"\\\n }\\\n ]\n }\n }\n }\n }\n}\n```\n\n## NJsonSchema.CodeGeneration usage\n\n[Permalink: NJsonSchema.CodeGeneration usage](https://github.com/RicoSuter/NJsonSchema#njsonschemacodegeneration-usage)\n\nThe `NJsonSchema.CodeGeneration` can be used to generate C# or TypeScript code from a JSON schema:\n\n```\nvar generator = new CSharpGenerator(schema);\nvar file = generator.GenerateFile();\n```\n\nThe `file` variable now contains the C# code for all the classes defined in the JSON schema.\n\n### TypeScript\n\n[Permalink: TypeScript](https://github.com/RicoSuter/NJsonSchema#typescript)\n\nThe previously generated JSON Schema would generate the following TypeScript interfaces.\n\n**Settings:**\n\n```\nnew TypeScriptGeneratorSettings { TypeStyle = TypeScriptTypeStyle.Interface, TypeScriptVersion = 4.3m }\n```\n\n**Output:**\n\n```\nexport enum Gender {\n Male = 0,\n Female = 1,\n}\n\nexport interface Company {\n Name: string | undefined;\n}\n\nexport interface Car {\n Name: string | undefined;\n Manufacturer: Company | undefined;\n}\n\nexport interface Person {\n FirstName: string;\n MiddleName: string | undefined;\n LastName: string;\n Gender: Gender;\n NumberWithRange: number;\n Birthday: Date;\n Company: Company | undefined;\n Cars: Car[] | undefined;\n}\n```\n\n... and the following TypeScript classes.\n\n**Settings:**\n\n```\nnew TypeScriptGeneratorSettings { TypeStyle = TypeScriptTypeStyle.Class, TypeScriptVersion = 4.3m }\n```\n\n**Output:**\n\n```\nexport enum Gender {\n Male = 0,\n Female = 1,\n}\n\nexport class Company implements ICompany {\n name: string | undefined;\n\n constructor(data?: ICompany) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(data?: any) {\n if (data) {\n this.name = data[\"Name\"];\n }\n }\n\n static fromJS(data: any): Company {\n let result = new Company();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"Name\"] = this.name;\n return data;\n }\n}\n\nexport interface ICompany {\n name: string | undefined;\n}\n\nexport class Car implements ICar {\n name: string | undefined;\n manufacturer: Company | undefined;\n\n constructor(data?: ICar) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(data?: any) {\n if (data) {\n this.name = data[\"Name\"];\n this.manufacturer = data[\"Manufacturer\"] ? Company.fromJS(data[\"Manufacturer\"]) : undefined;\n }\n }\n\n static fromJS(data: any): Car {\n let result = new Car();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"Name\"] = this.name;\n data[\"Manufacturer\"] = this.manufacturer ? this.manufacturer.toJSON() : undefined;\n return data;\n }\n}\n\nexport interface ICar {\n name: string | undefined;\n manufacturer: Company | undefined;\n}\n\nexport class Person implements IPerson {\n firstName: string;\n middleName: string | undefined;\n lastName: string;\n gender: Gender;\n numberWithRange: number;\n birthday: Date;\n company: Company | undefined;\n cars: Car[] | undefined;\n\n constructor(data?: IPerson) {\n if (data) {\n for (var property in data) {\n if (data.hasOwnProperty(property))\n (this)[property] = (data)[property];\n }\n }\n }\n\n init(data?: any) {\n if (data) {\n this.firstName = data[\"FirstName\"];\n this.middleName = data[\"MiddleName\"];\n this.lastName = data[\"LastName\"];\n this.gender = data[\"Gender\"];\n this.numberWithRange = data[\"NumberWithRange\"];\n this.birthday = data[\"Birthday\"] ? new Date(data[\"Birthday\"].toString()) : undefined;\n this.company = data[\"Company\"] ? Company.fromJS(data[\"Company\"]) : undefined;\n if (data[\"Cars\"] && data[\"Cars\"].constructor === Array) {\n this.cars = [];\n for (let item of data[\"Cars\"])\n this.cars.push(Car.fromJS(item));\n }\n }\n }\n\n static fromJS(data: any): Person {\n let result = new Person();\n result.init(data);\n return result;\n }\n\n toJSON(data?: any) {\n data = typeof data === 'object' ? data : {};\n data[\"FirstName\"] = this.firstName;\n data[\"MiddleName\"] = this.middleName;\n data[\"LastName\"] = this.lastName;\n data[\"Gender\"] = this.gender;\n data[\"NumberWithRange\"] = this.numberWithRange;\n data[\"Birthday\"] = this.birthday ? this.birthday.toISOString() : undefined;\n data[\"Company\"] = this.company ? this.company.toJSON() : undefined;\n if (this.cars && this.cars.constructor === Array) {\n data[\"Cars\"] = [];\n for (let item of this.cars)\n data[\"Cars\"].push(item.toJSON());\n }\n return data;\n }\n}\n\nexport interface IPerson {\n firstName: string;\n middleName: string | undefined;\n lastName: string;\n gender: Gender;\n numberWithRange: number;\n birthday: Date;\n company: Company | undefined;\n cars: Car[] | undefined;\n}\n```\n\n## NJsonSchema.SampleJsonSchemaGenerator usage\n\n[Permalink: NJsonSchema.SampleJsonSchemaGenerator usage](https://github.com/RicoSuter/NJsonSchema#njsonschemasamplejsonschemagenerator-usage)\n\nThe `NJsonSchema.SampleJsonSchemaGenerator` can be used to generate a JSON Schema from sample JSON data:\n\n### JSON Schema Specification\n\n[Permalink: JSON Schema Specification](https://github.com/RicoSuter/NJsonSchema#json-schema-specification)\n\nBy default, the `NJsonSchema.SampleJsonSchemaGenerator` generates a JSON Schema based on the JSON Schema specification. See: [JSON Schema Specification](https://json-schema.org/specification)\n\n```\nvar generator = new SampleJsonSchemaGenerator(new SampleJsonSchemaGeneratorSettings());\n\nvar schema = generator.Generate(\"{...}\");\n```\n\n**Input:**\n\n```\n{\n \"int\": 1,\n \"float\": 340282346638528859811704183484516925440.0,\n \"str\": \"abc\",\n \"bool\": true,\n \"date\": \"2012-07-19\",\n \"datetime\": \"2012-07-19 10:11:11\",\n \"timespan\": \"10:11:11\"\n}\n```\n\n**Output:**\n\n```\n{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"int\": {\n \"type\": \"integer\"\n },\n \"float\": {\n \"type\": \"number\"\n },\n \"str\": {\n \"type\": \"string\"\n },\n \"bool\": {\n \"type\": \"boolean\"\n },\n \"date\": {\n \"type\": \"string\",\n \"format\": \"date\"\n },\n \"datetime\": {\n \"type\": \"string\",\n \"format\": \"date-time\"\n },\n \"timespan\": {\n \"type\": \"string\",\n \"format\": \"duration\"\n }\n }\n}\n```\n\n### OpenApi Specification\n\n[Permalink: OpenApi Specification](https://github.com/RicoSuter/NJsonSchema#openapi-specification)\n\nTo generate a JSON Schema for OpenApi, provide the `SchemaType.OpenApi3` in the settings. See: [OpenApi Specification](https://swagger.io/specification/)\n\n```\nvar generator = new SampleJsonSchemaGenerator(new SampleJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 });\n\nvar schema = generator.Generate(\"{...}\");\n```\n\n**Input:**\n\n```\n{\n \"int\": 12345,\n \"long\": 1736347656630,\n \"float\": 340282346638528859811704183484516925440.0,\n \"double\": 340282346638528859811704183484516925440123456.0,\n}\n```\n\n**Output:**\n\n```\n{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"type\": \"object\",\n \"properties\": {\n \"int\": {\n \"type\": \"integer\",\n \"format\": \"int32\"\n },\n \"long\": {\n \"type\": \"integer\",\n \"format\": \"int64\"\n },\n \"float\": {\n \"type\": \"number\",\n \"format\": \"float\"\n },\n \"double\": {\n \"type\": \"number\",\n \"format\": \"double\"\n }\n }\n}\n```\n\n## Final notes\n\n[Permalink: Final notes](https://github.com/RicoSuter/NJsonSchema#final-notes)\n\nApplications which use the library:\n\n- [VisualJsonEditor](http://visualjsoneditor.org/), a JSON schema based file editor for Windows.\n- [NSwag](http://nswag.org/): The Swagger API toolchain for .NET\n- [SigSpec for SignalR Core](https://github.com/RicoSuter/SigSpec): Specification and code generator for SignalR Core.\n\n## About\n\nJSON Schema reader, generator and validator for .NET\n\n\n[NJsonSchema.org](http://njsonschema.org/ \"http://NJsonSchema.org\")\n\n### Resources\n\n[Readme](https://github.com/RicoSuter/NJsonSchema#readme-ov-file)\n\n### License\n\n[MIT license](https://github.com/RicoSuter/NJsonSchema#MIT-1-ov-file)\n\n### Contributing\n\n[Contributing](https://github.com/RicoSuter/NJsonSchema#contributing-ov-file)\n\n### Uh oh!\n\nThere was an error while loading. [Please reload this page](https://github.com/RicoSuter/NJsonSchema).\n\n[Activity](https://github.com/RicoSuter/NJsonSchema/activity)\n\n### Stars\n\n[**1.6k**\\\\\nstars](https://github.com/RicoSuter/NJsonSchema/stargazers)\n\n### Watchers\n\n[**33**\\\\\nwatching](https://github.com/RicoSuter/NJsonSchema/watchers)\n\n### Forks\n\n[**548**\\\\\nforks](https://github.com/RicoSuter/NJsonSchema/forks)\n\n[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2FRicoSuter%2FNJsonSchema&report=RicoSuter+%28user%29)\n\n## [Releases\\ 1,212](https://github.com/RicoSuter/NJsonSchema/releases)\n\n[NJsonSchema v11.5.2\\\\\nLatest\\\\\n\\\\\non Nov 5, 2025Nov 5, 2025](https://github.com/RicoSuter/NJsonSchema/releases/tag/v11.5.2)\n\n[\\+ 1,211 releases](https://github.com/RicoSuter/NJsonSchema/releases)\n\n## Sponsor this project\n\n[![@RicoSuter](https://avatars.githubusercontent.com/u/2603405?s=64&v=4)](https://github.com/RicoSuter)[**RicoSuter** Rico Suter](https://github.com/RicoSuter)\n\n[Sponsor](https://github.com/sponsors/RicoSuter)\n\n[Learn more about GitHub Sponsors](https://github.com/sponsors)\n\n## [Packages\\ 0](https://github.com/users/RicoSuter/packages?repo_name=NJsonSchema)\n\nNo packages published\n\n## [Used by 3k](https://github.com/RicoSuter/NJsonSchema/network/dependents)\n\n[- ![@Sichii](https://avatars.githubusercontent.com/u/14322214?s=64&v=4)\\\\\n- ![@arekpalinski](https://avatars.githubusercontent.com/u/376551?s=64&v=4)\\\\\n- ![@bbrk364](https://avatars.githubusercontent.com/u/12089676?s=64&v=4)\\\\\n- ![@Plinqx](https://avatars.githubusercontent.com/u/140214696?s=64&v=4)\\\\\n- ![@skymaxvalue](https://avatars.githubusercontent.com/u/268767680?s=64&v=4)\\\\\n- ![@AJ-comp](https://avatars.githubusercontent.com/u/69152847?s=64&v=4)\\\\\n- ![@alexandercarlis2-dotcom](https://avatars.githubusercontent.com/u/259317199?s=64&v=4)\\\\\n- ![@ballware](https://avatars.githubusercontent.com/u/80540376?s=64&v=4)\\\\\n\\\\\n\\+ 2,986](https://github.com/RicoSuter/NJsonSchema/network/dependents)\n\n## [Contributors\\ 212](https://github.com/RicoSuter/NJsonSchema/graphs/contributors)\n\n- [![@RicoSuter](https://avatars.githubusercontent.com/u/2603405?s=64&v=4)](https://github.com/RicoSuter)\n- [![@lahma](https://avatars.githubusercontent.com/u/171892?s=64&v=4)](https://github.com/lahma)\n- [![@trejjam](https://avatars.githubusercontent.com/u/3594540?s=64&v=4)](https://github.com/trejjam)\n- [![@jkonecki](https://avatars.githubusercontent.com/u/1775247?s=64&v=4)](https://github.com/jkonecki)\n- [![@Copilot](https://avatars.githubusercontent.com/in/1143301?s=64&v=4)](https://github.com/apps/copilot-swe-agent)\n- [![@claude](https://avatars.githubusercontent.com/u/81847?s=64&v=4)](https://github.com/claude)\n- [![@danzel](https://avatars.githubusercontent.com/u/393086?s=64&v=4)](https://github.com/danzel)\n- [![@testfirstcoder](https://avatars.githubusercontent.com/u/12428122?s=64&v=4)](https://github.com/testfirstcoder)\n- [![@rogerbramon](https://avatars.githubusercontent.com/u/330441?s=64&v=4)](https://github.com/rogerbramon)\n- [![@z16](https://avatars.githubusercontent.com/u/1635608?s=64&v=4)](https://github.com/z16)\n- [![@markledwich2](https://avatars.githubusercontent.com/u/17095341?s=64&v=4)](https://github.com/markledwich2)\n- [![@lheiskan](https://avatars.githubusercontent.com/u/189382?s=64&v=4)](https://github.com/lheiskan)\n- [![@ili](https://avatars.githubusercontent.com/u/787292?s=64&v=4)](https://github.com/ili)\n- [![@Zehelein](https://avatars.githubusercontent.com/u/9946441?s=64&v=4)](https://github.com/Zehelein)\n\n[\\+ 198 contributors](https://github.com/RicoSuter/NJsonSchema/graphs/contributors)\n\n## Languages\n\n- [C#96.9%](https://github.com/RicoSuter/NJsonSchema/search?l=c%23)\n- [Liquid2.7%](https://github.com/RicoSuter/NJsonSchema/search?l=liquid)\n- Other0.4%\n\nYou can’t perform that action at this time.","metadata":{"color-scheme":"light dark","ogSiteName":"GitHub","go-import":"github.com/RicoSuter/NJsonSchema git https://github.com/RicoSuter/NJsonSchema.git","route-controller":"files","turbo-body-classes":"logged-out env-production page-responsive","og:site_name":"GitHub","theme-color":"#1e2327","twitter:description":"JSON Schema reader, generator and validator for .NET - RicoSuter/NJsonSchema","viewport":"width=device-width","og:image:height":"600","ogUrl":"https://github.com/RicoSuter/NJsonSchema","user-login":"","octolytics-dimension-repository_public":"true","ogImage":"https://opengraph.githubassets.com/8595b380ed8bfd420bbdb4365bcd0b9311e41a4107e729febaf0462aaa56fbdb/RicoSuter/NJsonSchema","disable-turbo":"false","octolytics-dimension-repository_nwo":"RicoSuter/NJsonSchema","fb:app_id":"1401488693436528","octolytics-dimension-user_login":"RicoSuter","octolytics-dimension-repository_is_fork":"false","twitter:image":"https://opengraph.githubassets.com/8595b380ed8bfd420bbdb4365bcd0b9311e41a4107e729febaf0462aaa56fbdb/RicoSuter/NJsonSchema","github-keyboard-shortcuts":"repository,copilot","og:description":"JSON Schema reader, generator and validator for .NET - RicoSuter/NJsonSchema","google-site-verification":"Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I","analytics-location":"//","twitter:title":"GitHub - RicoSuter/NJsonSchema: JSON Schema reader, generator and validator for .NET","og:type":"object","visitor-payload":"eyJyZWZlcnJlciI6Imh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vIiwicmVxdWVzdF9pZCI6IjVGOUY6Mjc0MTQ0OjQwOEVBQzY6NTI5MzMxNTo2OUM5MEM0RSIsInZpc2l0b3JfaWQiOiI5ODE3ODM2Mjg0MTMwNDE0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9","ui-target":"full","hostname":"github.com","current-catalog-service-hash":"f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb","html-safe-nonce":"954746b907b7d8ecaedacfc2e31f901f2f3fa10992290ed12ec47bd94badd8bc","og:image:width":"1200","browser-errors-url":"https://api.github.com/_private/browser/errors","twitter:site":"@github","browser-stats-url":"https://api.github.com/_private/browser/stats","route-pattern":"/:user_id/:repository","octolytics-dimension-repository_network_root_id":"27784297","release":"51d2e33e3d1e4839c3ced5f8e35c7a47d3a60f32","visitor-hmac":"dd4e17405f1d55bdbc2ddf0624ffdf2558c368f4d794c6475d0ae933728aae37","route-action":"disambiguate","octolytics-url":"https://collector.github.com/github/collect","fetch-nonce":"v2:8b2cca80-5cef-7b21-3262-023fb8a5506a","request-id":"5F9F:274144:408EAC6:5293315:69C90C4E","octolytics-dimension-repository_id":"27784297","expected-hostname":"github.com","ogDescription":"JSON Schema reader, generator and validator for .NET - RicoSuter/NJsonSchema","language":"en","ogTitle":"GitHub - RicoSuter/NJsonSchema: JSON Schema reader, generator and validator for .NET","og:image:alt":"JSON Schema reader, generator and validator for .NET - RicoSuter/NJsonSchema","octolytics-dimension-user_id":"2603405","og:url":"https://github.com/RicoSuter/NJsonSchema","twitter:card":"summary_large_image","og:title":"GitHub - RicoSuter/NJsonSchema: JSON Schema reader, generator and validator for .NET","octolytics-dimension-repository_network_root_nwo":"RicoSuter/NJsonSchema","hovercard-subject-tag":"repository:27784297","title":"GitHub - RicoSuter/NJsonSchema: JSON Schema reader, generator and validator for .NET · GitHub","turbo-cache-control":["no-preview","no-cache"],"og:image":"https://opengraph.githubassets.com/8595b380ed8bfd420bbdb4365bcd0b9311e41a4107e729febaf0462aaa56fbdb/RicoSuter/NJsonSchema","description":"JSON Schema reader, generator and validator for .NET - RicoSuter/NJsonSchema","apple-itunes-app":"app-id=1477376905, app-argument=https://github.com/RicoSuter/NJsonSchema","favicon":"https://github.githubassets.com/favicons/favicon.svg","scrapeId":"019d3958-141a-7774-9be9-9bcb52deed83","sourceURL":"https://github.com/RicoSuter/NJsonSchema","url":"https://github.com/RicoSuter/NJsonSchema","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"a51267cb-7105-4c96-83d1-e60a5c65b769","creditsUsed":1}},{"url":"https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema","title":"Generate JSON Schema from sample JSON data in C# with ...","description":"I am trying to generate a JSON schema from a JSON string that I have in memory. I am using the NJsonSchema off of GitHub.","position":3,"markdown":"##### Collectives™ on Stack Overflow\n\nFind centralized, trusted content and collaborate around the technologies you use most.\n\n[Learn more about Collectives](https://stackoverflow.com/collectives)\n\n**Stack Internal**\n\nKnowledge at work\n\nBring the best of human thought and AI automation together at your work.\n\n[Explore Stack Internal](https://stackoverflow.co/internal/?utm_medium=referral&utm_source=stackoverflow-community&utm_campaign=side-bar&utm_content=explore-teams-compact-popover)\n\n# [Generate JSON Schema from sample JSON data in C\\# with NJsonSchema](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema)\n\n[Ask Question](https://stackoverflow.com/questions/ask)\n\nAsked9 years, 7 months ago\n\nModified [7 years, 4 months ago](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema?lastactivity \"2018-11-05 20:33:18Z\")\n\nViewed\n10k times\n\n\nThis question shows research effort; it is useful and clear\n\n2\n\nSave this question.\n\n[Timeline](https://stackoverflow.com/posts/39182123/timeline)\n\nShow activity on this post.\n\nI am hoping this is me not holding it right, but I am trying to generate a JSON schema from a JSON string that I have in memory.\n\nI am using the NJsonSchema off of GitHub. [https://github.com/NJsonSchema/NJsonSchema/](https://github.com/NJsonSchema/NJsonSchema/)\n\n```\nstring json = @\"{\n \"\"a\"\": 1,\n \"\"name\"\": \"\"Bill Smith\"\",\n \"\"isTall\"\": true\n}\";\n\nvar schemaItem = JsonSchema4.FromJson(json);\nstring jsonSchema = schemaItem.ToJson();\n```\n\nWhen I execute the code above I get the following value in jsonSchema which is not correct.\n\n```\n{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"a\": 1,\n \"name\": \"Bill Smith\",\n \"isTall\": true\n}\n```\n\nI have created a GitHub bug for it for the time being just in case. [https://github.com/NJsonSchema/NJsonSchema/issues/180](https://github.com/NJsonSchema/NJsonSchema/issues/180)\n\n- [c#](https://stackoverflow.com/questions/tagged/c%23 \"show questions tagged 'c#'\")\n- [json](https://stackoverflow.com/questions/tagged/json \"show questions tagged 'json'\")\n- [njsonschema](https://stackoverflow.com/questions/tagged/njsonschema \"show questions tagged 'njsonschema'\")\n\n[Share](https://stackoverflow.com/q/39182123 \"Short permalink to this question\")\n\n[Improve this question](https://stackoverflow.com/posts/39182123/edit \"\")\n\nFollow\n\n\n\nFollow this question to receive notifications\n\n[edited May 7, 2017 at 20:30](https://stackoverflow.com/posts/39182123/revisions \"show all edits to this post\")\n\n[![halfer's user avatar](https://i.sstatic.net/4rtxd.png?s=64)](https://stackoverflow.com/users/472495/halfer)\n\n[halfer](https://stackoverflow.com/users/472495/halfer)\n\n20.2k2020 gold badges112112 silver badges208208 bronze badges\n\nasked Aug 27, 2016 at 14:16\n\n[![Jerrod Horton's user avatar](https://i.sstatic.net/KL6HZ.jpg?s=64)](https://stackoverflow.com/users/4425676/jerrod-horton)\n\n[Jerrod Horton](https://stackoverflow.com/users/4425676/jerrod-horton)\n\n1,71233 gold badges1717 silver badges3131 bronze badges\n\n[Add a comment](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema# \"Use comments to ask for more information or suggest improvements. Avoid answering questions in comments.\") \\| [Expand to show all comments on this post](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema# \"Expand to show all comments on this post\")\n\n## 2 Answers 2\n\nSorted by:\n[Reset to default](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema?answertab=scoredesc#tab-top)\n\nHighest score (default)\n\nTrending (recent votes count more)\n\nDate modified (newest first)\n\nDate created (oldest first)\n\n\nThis answer is useful\n\n3\n\nSave this answer.\n\n[Timeline](https://stackoverflow.com/posts/41600730/timeline)\n\nShow activity on this post.\n\nIn the current version of [NJsonSchema](http://njsonschema.org/) you can generate a JSON Schema from sample data:\n\n**See [https://github.com/RSuter/NJsonSchema/wiki/SampleJsonSchemaGenerator](https://github.com/RSuter/NJsonSchema/wiki/SampleJsonSchemaGenerator)**\n\nThe commit: [https://github.com/NJsonSchema/NJsonSchema/commit/28d5a1357a9b5a3367154d3bc6e2488769b721aa](https://github.com/NJsonSchema/NJsonSchema/commit/28d5a1357a9b5a3367154d3bc6e2488769b721aa)\n\nWill be available in version v7.6.\n\nThe DataToJsonSchemaGenerator: [https://github.com/NJsonSchema/NJsonSchema/blob/master/src/NJsonSchema/Generation/DataToJsonSchemaGenerator.cs](https://github.com/NJsonSchema/NJsonSchema/blob/master/src/NJsonSchema/Generation/DataToJsonSchemaGenerator.cs)\n\nI think there's also a FromJsonData method on JsonSchema4....\n\n[Share](https://stackoverflow.com/a/41600730 \"Short permalink to this answer\")\n\n[Improve this answer](https://stackoverflow.com/posts/41600730/edit \"\")\n\nFollow\n\n\n\nFollow this answer to receive notifications\n\n[edited Nov 5, 2018 at 20:33](https://stackoverflow.com/posts/41600730/revisions \"show all edits to this post\")\n\nanswered Jan 11, 2017 at 21:09\n\n[![Rico Suter's user avatar](https://www.gravatar.com/avatar/b4a49a957a8aa04c94233abab37ec6c4?s=64&d=identicon&r=PG)](https://stackoverflow.com/users/876814/rico-suter)\n\n[Rico Suter](https://stackoverflow.com/users/876814/rico-suter)\n\n12k66 gold badges6969 silver badges9898 bronze badges\n\nSign up to request clarification or add additional context in comments.\n\n\n## Comments\n\nAdd a comment\n\nThis answer is useful\n\n1\n\nSave this answer.\n\n[Timeline](https://stackoverflow.com/posts/39182285/timeline)\n\nShow activity on this post.\n\nYou are using it wrong, `JsonSchema4.FromJson(string json)` is used to load existing schema json, not loading arbitrary json and generating a schema from it.\n\nWhat you might be looking for is `JsonSchema4.FromType()` which can generate a schema from a type, though you would need to have actual types for everything then.\n\nAs far as I can tell there isn't any way to generate a schema from just json so you'll need to create a class that matches your input. If you need that then you can have a look at [http://www.newtonsoft.com/jsonschema](http://www.newtonsoft.com/jsonschema), though it is not a free solution (and I'm in no way affiliated with it).\n\n[Share](https://stackoverflow.com/a/39182285 \"Short permalink to this answer\")\n\n[Improve this answer](https://stackoverflow.com/posts/39182285/edit \"\")\n\nFollow\n\n\n\nFollow this answer to receive notifications\n\nanswered Aug 27, 2016 at 14:36\n\n[![Karl-Johan Sjögren's user avatar](https://www.gravatar.com/avatar/c4b225b23e824b87350647be70b5c44c?s=64&d=identicon&r=PG)](https://stackoverflow.com/users/547640/karl-johan-sj%c3%b6gren)\n\n[Karl-Johan Sjögren](https://stackoverflow.com/users/547640/karl-johan-sj%c3%b6gren)\n\n17.8k77 gold badges6767 silver badges7575 bronze badges\n\n## 3 Comments\n\nAdd a comment\n\n[![](https://i.sstatic.net/KL6HZ.jpg?s=64)](https://stackoverflow.com/users/4425676/jerrod-horton)\n\nJerrod Horton\n\n[Jerrod Horton](https://stackoverflow.com/users/4425676/jerrod-horton) [Over a year ago](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema#comment65711108_39182285)\n\nThanks for the response. Unfortunately creating types for my json objects is not something I have the opportunity to do with the application for which I am using it. I am looking to do exactly what this does: [jsonschema.net/#](http://jsonschema.net/#/). I have an object represented in JSON and I want the associated JSON Schema. Also, It seems that JsonSchema4.FromUrl(validUrlWithJson) works how I would expect as well. It takes the JSON from that URL and seems to create a schema from it.\n\n2016-08-27T19:24:19.343Z+00:00\n\n0\n\nReply\n\n- Copy link\n\n[![](https://www.gravatar.com/avatar/c4b225b23e824b87350647be70b5c44c?s=48&d=identicon&r=PG)](https://stackoverflow.com/users/547640/karl-johan-sj%c3%b6gren)\n\nKarl-Johan Sjögren\n\n[Karl-Johan Sjögren](https://stackoverflow.com/users/547640/karl-johan-sj%c3%b6gren) [Over a year ago](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema#comment65712863_39182285)\n\nJust had a look at the source for `JsonSchema4.FromUrl` and all it does it is fetch data from a url and then pass it to `JsonSchema4.FromJson` so it won't help you. I'm afraid that you might need to code this one yourself though it shouldn't be that hard to do since json just have a few types for you to handle (string, int, bool, possibly date).\n\n2016-08-27T21:16:35.7Z+00:00\n\n0\n\nReply\n\n- Copy link\n\n[![](https://i.sstatic.net/KL6HZ.jpg?s=64)](https://stackoverflow.com/users/4425676/jerrod-horton)\n\nJerrod Horton\n\n[Jerrod Horton](https://stackoverflow.com/users/4425676/jerrod-horton) [Over a year ago](https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema#comment65723882_39182285)\n\nYeah thanks. I was hoping something would do it for me so I didn't have to run the risk of meaaibg up the schema from hand building it.\n\n2016-08-28T13:15:02.423Z+00:00\n\n0\n\nReply\n\n- Copy link\n\nAdd a comment\n\n## Your Answer\n\nDraft saved\n\nDraft discarded\n\n### Sign up or [log in](https://stackoverflow.com/users/login?ssrc=question_page&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f39182123%2fgenerate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema%23new-answer)\n\nSign up using Google\n\n\nSign up using Email and Password\n\n\nSubmit\n\n### Post as a guest\n\nName\n\nEmail\n\nRequired, but never shown\n\nPost Your Answer\n\nDiscard\n\n\nBy clicking “Post Your Answer”, you agree to our [terms of service](https://stackoverflow.com/legal/terms-of-service/public) and acknowledge you have read our [privacy policy](https://stackoverflow.com/legal/privacy-policy).\n\n\nStart asking to get answers\n\nFind the answer to your question by asking.\n\n[Ask question](https://stackoverflow.com/questions/ask)\n\nExplore related questions\n\n- [c#](https://stackoverflow.com/questions/tagged/c%23 \"show questions tagged 'c#'\")\n- [json](https://stackoverflow.com/questions/tagged/json \"show questions tagged 'json'\")\n- [njsonschema](https://stackoverflow.com/questions/tagged/njsonschema \"show questions tagged 'njsonschema'\")\n\nSee similar questions with these tags.\n\nlang-cs","metadata":{"isPartOf":"https://stackoverflow.com/#website","title":"Generate JSON Schema from sample JSON data in C# with NJsonSchema - Stack Overflow","ogImage":"https://stackoverflow.com/Content/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=0f0cab681579","publisher":"https://stackoverflow.com/#organization","description":"I am hoping this is me not holding it right, but I am trying to generate a JSON schema from a JSON string that I have in memory.\n\nI am using the NJsonSchema off of GitHub. https://github.com/NJson...","name":["Generate JSON Schema from sample JSON data in C# with NJsonSchema","Jerrod Horton","Rico Suter","Karl-Johan Sjögren"],"twitter:domain":"stackoverflow.com","og:url":"https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema","ogTitle":"Generate JSON Schema from sample JSON data in C# with NJsonSchema","language":"en","og:type":"website","og:site_name":"Stack Overflow","twitter:card":"summary","twitter:title":"Generate JSON Schema from sample JSON data in C# with NJsonSchema","ogDescription":"I am hoping this is me not holding it right, but I am trying to generate a JSON schema from a JSON string that I have in memory.\n\nI am using the NJsonSchema off of GitHub. https://github.com/NJson...","viewport":"width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0","ogSiteName":"Stack Overflow","twitter:description":"I am hoping this is me not holding it right, but I am trying to generate a JSON schema from a JSON string that I have in memory.\n\nI am using the NJsonSchema off of GitHub. https://github.com/NJson...","image":"https://stackoverflow.com/Content/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=0f0cab681579","ogUrl":"https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema","url":"https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema","og:image":"https://stackoverflow.com/Content/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=0f0cab681579","primaryImageOfPage":"https://stackoverflow.com/Content/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=0f0cab681579","favicon":"https://stackoverflow.com/Content/Sites/stackoverflow/Img/favicon.ico?v=562fb39d93c8","scrapeId":"019d3958-141a-7774-9be9-9f9c89c75c1d","sourceURL":"https://stackoverflow.com/questions/39182123/generate-json-schema-from-sample-json-data-in-c-sharp-with-njsonschema","statusCode":200,"contentType":"text/html; charset=utf-8","timezone":"America/New_York","proxyUsed":"basic","cacheState":"miss","indexId":"6d381836-1189-4ff0-aa54-c9e00d48d71c","creditsUsed":1}}]}}