internal void RegisterLocal(JsonSchema schema) { if (schema.Id != null && schema.Id.IsLocalSchemaId()) { Log.Schema($"Registering \"{schema.Id}\""); lock (_contextLookup) { _contextLookup[schema.Id] = schema; } } var anchor = schema.Get <AnchorKeyword>(); if (anchor != null) { var anchorUri = $"{schema.DocumentPath}#{anchor.Value}"; Log.Schema($"Registering \"{anchorUri}\""); lock (_contextLookup) { _contextLookup[anchorUri] = schema; } } }
/// <summary> /// Gets the value for the `maxContains` keyword, if present. /// </summary> public static double?MaxContains(this JsonSchema schema) { return(schema.Get <MaxContainsKeyword>()?.Value); }
/// <summary> /// Gets the value for the `contentSchema` keyword, if present. /// </summary> public static JsonSchema?ContentSchema(this JsonSchema schema) { return(schema.Get <ContentSchemaKeyword>()?.Value); }
/// <summary> /// Gets the value for the `contentEncoding` keyword, if present. /// </summary> public static string?ContentEncoding(this JsonSchema schema) { return(schema.Get <ContentEncodingKeyword>()?.Value); }
/// <summary> /// Gets the value for the `$comment` keyword, if present. /// </summary> public static string?Comment(this JsonSchema schema) { return(schema.Get <CommentKeyword>()?.Value); }
/// <summary> /// Gets the value for the `uniqueItems` keyword, if present. /// </summary> public static Dictionary <SchemaVocabulary, bool>?Vocabulary(this JsonSchema schema) { return(schema.Get <VocabularyKeyword>()); }
/// <summary> /// Gets the value for the `unevaluatedProperties` keyword, if present. /// </summary> public static JsonSchema?UnevaluatedProperties(this JsonSchema schema) { return(schema.Get <UnevaluatedPropertiesKeyword>()?.Value); }
/// <summary> /// Gets the value for the `then` keyword, if present. /// </summary> public static JsonSchema?Then(this JsonSchema schema) { return(schema.Get <ThenKeyword>()?.Value); }
/// <summary> /// Gets the value for the `not` keyword, if present. /// </summary> public static JsonSchema?Not(this JsonSchema schema) { return(schema.Get <NotKeyword>()?.Value); }
/// <summary> /// Gets the value for the `multipleOf` keyword, if present. /// </summary> public static double?MultipleOf(this JsonSchema schema) { return(schema.Get <MultipleOfKeyword>()?.Value); }
/// <summary> /// Gets the value for the `minProperties` keyword, if present. /// </summary> public static double?MinProperties(this JsonSchema schema) { return(schema.Get <MinPropertiesKeyword>()?.Value); }
/// <summary> /// Gets the value for the `minLength` keyword, if present. /// </summary> public static double?MinLength(this JsonSchema schema) { return(schema.Get <MinLengthKeyword>()?.Value); }
/// <summary> /// Gets the value for the `minItems` keyword, if present. /// </summary> public static double?MinItems(this JsonSchema schema) { return(schema.Get <MinItemsKeyword>()?.Value); }
/// <summary> /// Gets the value for the `additionalProperties` keyword, if present. /// </summary> public static JsonSchema?AdditionalProperties(this JsonSchema schema) { return(schema.Get <AdditionalPropertiesKeyword>()?.Value); }
/// <summary> /// Gets the value for the `maximum` keyword, if present. /// </summary> public static double?Maximum(this JsonSchema schema) { return(schema.Get <MaximumKeyword>()?.Value); }
/// <summary> /// Gets the value for the `anyOf` keyword, if present. /// </summary> public static List <JsonSchema>?AnyOf(this JsonSchema schema) { return(schema.Get <AnyOfKeyword>()); }
/// <summary> /// Gets the value for the `$schema` keyword, if present. /// </summary> public static string?Schema(this JsonSchema schema) { return(schema.Get <SchemaKeyword>()?.Value); }
/// <summary> /// Gets the value for the `pattern` keyword, if present. /// </summary> public static Regex?Pattern(this JsonSchema schema) { return(schema.Get <PatternKeyword>()?.Value); }
/// <summary> /// Gets the value for the `title` keyword, if present. /// </summary> public static string?Title(this JsonSchema schema) { return(schema.Get <TitleKeyword>()?.Value); }
/// <summary> /// Gets the value for the `properties` keyword, if present. /// </summary> public static Dictionary <string, JsonSchema>?Properties(this JsonSchema schema) { return(schema.Get <PropertiesKeyword>()); }
/// <summary> /// Gets the value for the `uniqueItems` keyword, if present. /// </summary> public static bool UniqueItems(this JsonSchema schema) { return(schema.Get <UniqueItemsKeyword>()?.Value ?? false); }
/// <summary> /// Gets the value for the `propertyNames` keyword, if present. /// </summary> public static JsonSchema?PropertyNames(this JsonSchema schema) { return(schema.Get <PropertyNamesKeyword>()?.Value); }
/// <summary> /// Gets the value for the `writeOnly` keyword, if present. /// </summary> public static bool WriteOnly(this JsonSchema schema) { return(schema.Get <WriteOnlyKeyword>()?.Value ?? false); }
/// <summary> /// Gets the value for the `$recursiveAnchor` keyword, if present. /// </summary> public static bool RecursiveAnchor(this JsonSchema schema) { return(schema.Get <RecursiveAnchorKeyword>()?.Value ?? false); }
/// <summary> /// Gets the value for the `const` keyword, if present. /// </summary> public static JsonValue?Const(this JsonSchema schema) { return(schema.Get <ConstKeyword>()?.Value); }
/// <summary> /// Gets the value for the `$ref` keyword, if present. /// </summary> public static string?Ref(this JsonSchema schema) { return(schema.Get <RefKeyword>()?.Reference); }
/// <summary> /// Gets the value for the `contentMediaType` keyword, if present. /// </summary> public static string?ContentMediaType(this JsonSchema schema) { return(schema.Get <ContentMediaTypeKeyword>()?.Value); }
/// <summary> /// Gets the resolved schema for the `$ref` keyword, if present. /// </summary> public static JsonSchema?RefResolved(this JsonSchema schema) { return(schema.Get <RefKeyword>()?.Resolved); }
/// <summary> /// Gets the value for the `default` keyword, if present. /// </summary> public static JsonValue?Default(this JsonSchema schema) { return(schema.Get <DefaultKeyword>()?.Value); }
/// <summary> /// Gets the value for the `required` keyword, if present. /// </summary> public static List <string>?Required(this JsonSchema schema) { return(schema.Get <RequiredKeyword>()); }