Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:20:57+00:00 2026-05-28T01:20:57+00:00

I have a JSONSchema which will have some items . Now the schema/s that

  • 0

I have a JSONSchema which will have some items . Now the schema/s that define those items need to be referred in the main schema ?

* one schema that you reference:
 { 
    "id": "http://some.where/sub/schema#", 
    "type": "object", 
    "properties": { 
        "p1": { 
            "type": "integer", 
            "minimum": 12 
        } 
    }     
} 
--- * the main schema: ---- 
{ 
    "id": "http://path.to/base/schema#", 
    "type": "array", 
    "items": { 
        "extends": { 
            "$ref": "http://some.where/sub/schema#/properties/p1" 
        }, 
        "divisibleBy": 5 
    }     
} 

Also note , i will have multiple items in the item . I do not see a way of doing this in the api . Nor does the api allow me to add custom properties . How can i achieve this ? I am using JSON.net.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:20:57+00:00Added an answer on May 28, 2026 at 1:20 am

    Since It will be too long for a comment, I’ll post it as an answer. But You should work on it to customize according to your needs.

    string oneSchema = @"{ 
        ""id"": ""http://some.where/sub/schema#"", 
        ""type"": ""object"", 
        ""properties"": { 
            ""p1"": { 
                ""type"": ""integer"", 
                ""minimum"": 12 
            } 
        }     
    } ";
    
    string main = @"
    { 
        ""id"": ""http://path.to/base/schema#"", 
        ""type"": ""array"", 
        ""items"": { 
            ""extends"": { 
                ""$ref"": ""http://some.where/sub/schema#/properties/p1"" 
            }, 
            ""divisibleBy"": 5 
        }     
    }";
    
    var JObjMain = (JObject)JsonConvert.DeserializeObject(main);
    var jObjOther = (JObject)JsonConvert.DeserializeObject(oneSchema);
    
    JToken src = JObjMain["items"]["extends"]["$ref"];
    JToken reference = jObjOther["id"];
    
    
    var path = src.ToString().Replace(reference.ToString(), "").Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
    JToken j = jObjOther[path[0]];
    for(int i=1;i<path.Length;i++)
    {
        j = j[path[i]];
    }
    
    src.Replace(j);
    
    Console.WriteLine(JObjMain);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a look at one of my websites: moskah.com The problem is that it
Have some dates in my local Oracle 11g database that are in this format:
I want to formally define a schema for a JSON-based protocol. I have two
Have a bunch of classes which I need to do serialize and deserialize from/to
For one of my projects , which validates JSON using JSON Schema, I miss
If I have a JSON Schema that specifies a default value for a property,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a bunch of WCF REST services hosted on Azure that access a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.