Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
300 changed files
with
32,848 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="JsonSchemaAttribute.cs" company="NJsonSchema"> | ||
// Copyright (c) Rico Suter. All rights reserved. | ||
// </copyright> | ||
// <license>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</license> | ||
// <author>Rico Suter, mail@rsuter.com</author> | ||
//----------------------------------------------------------------------- | ||
|
||
using System; | ||
|
||
namespace NJsonSchema.Annotations | ||
{ | ||
/// <summary>Annotation to specify the JSON Schema type for the given class.</summary> | ||
[AttributeUsage(AttributeTargets.Class)] | ||
public class JsonSchemaAttribute : Attribute | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="JsonSchemaAttribute"/> class.</summary> | ||
public JsonSchemaAttribute() | ||
{ | ||
Type = JsonObjectType.None; | ||
} | ||
|
||
/// <summary>Initializes a new instance of the <see cref="JsonSchemaAttribute"/> class.</summary> | ||
/// <param name="type">The JSON Schema type.</param> | ||
public JsonSchemaAttribute(JsonObjectType type) | ||
{ | ||
Type = type; | ||
} | ||
|
||
/// <summary>Gets the JSON Schema type (default: <see cref="JsonObjectType.None"/>, i.e. derived from <see cref="System.Type"/>).</summary> | ||
public JsonObjectType Type { get; private set; } | ||
|
||
/// <summary>Gets or sets the JSON format type (default: <c>null</c>, i.e. derived from <see cref="System.Type"/>).</summary> | ||
public string Format { get; set; } | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
NJsonSchema/Annotations/JsonSchemaExtensionDataAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="JsonSchemaExtensionDataAttribute.cs" company="NJsonSchema"> | ||
// Copyright (c) Rico Suter. All rights reserved. | ||
// </copyright> | ||
// <license>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</license> | ||
// <author>Rico Suter, mail@rsuter.com</author> | ||
//----------------------------------------------------------------------- | ||
|
||
using System; | ||
|
||
namespace NJsonSchema.Annotations | ||
{ | ||
/// <summary>Adds an extension data property to a class or property.</summary> | ||
/// <seealso cref="System.Attribute" /> | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] | ||
public class JsonSchemaExtensionDataAttribute : Attribute | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="JsonSchemaExtensionDataAttribute"/> class.</summary> | ||
/// <param name="property">The property.</param> | ||
/// <param name="value">The value.</param> | ||
public JsonSchemaExtensionDataAttribute(string property, object value) | ||
{ | ||
Property = property; | ||
Value = value; | ||
} | ||
|
||
/// <summary>Gets the property name.</summary> | ||
public string Property { get; private set; } | ||
|
||
/// <summary>Gets the value.</summary> | ||
public object Value { get; private set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="MultipleOfAttribute.cs" company="NJsonSchema"> | ||
// Copyright (c) Rico Suter. All rights reserved. | ||
// </copyright> | ||
// <license>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</license> | ||
// <author>Rico Suter, mail@rsuter.com</author> | ||
//----------------------------------------------------------------------- | ||
|
||
using System; | ||
|
||
namespace NJsonSchema.Annotations | ||
{ | ||
/// <summary>Attribute to set the multipleOf parameter of a JSON Schema.</summary> | ||
[AttributeUsage(AttributeTargets.Property)] | ||
public class MultipleOfAttribute : Attribute | ||
{ | ||
/// <summary>Initializes a new instance of the <see cref="MultipleOfAttribute"/> class.</summary> | ||
/// <param name="multipleOf">The multipleOf value.</param> | ||
public MultipleOfAttribute(double multipleOf) | ||
{ | ||
MultipleOf = multipleOf; | ||
} | ||
|
||
/// <summary>Gets the value whose modulo the the JSON value must be zero.</summary> | ||
public double MultipleOf { get; private set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace NJsonSchema | ||
{ | ||
// This project can output the Class library as a NuGet Package. | ||
// To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build". | ||
public class Class1 | ||
{ | ||
public Class1() | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.