Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikov committed May 31, 2016
1 parent 55466da commit b9b16b1
Show file tree
Hide file tree
Showing 300 changed files with 32,848 additions and 0 deletions.
36 changes: 36 additions & 0 deletions NJsonSchema/Annotations/JsonSchemaAttribute.cs
@@ -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 NJsonSchema/Annotations/JsonSchemaExtensionDataAttribute.cs
@@ -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; }
}
}
27 changes: 27 additions & 0 deletions NJsonSchema/Annotations/MultipleOfAttribute.cs
@@ -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; }
}
}
16 changes: 16 additions & 0 deletions NJsonSchema/Class1.cs
@@ -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()
{
}
}
}

0 comments on commit b9b16b1

Please sign in to comment.