Skip to content

Commit

Permalink
Merge pull request #825 from RSuter/master
Browse files Browse the repository at this point in the history
Release v9.12.6
  • Loading branch information
RicoSuter authored Nov 29, 2018
2 parents 5e2dd88 + 7a9266a commit 2e62595
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451</TargetFrameworks>
<Description>JSON Schema reader, generator and validator for .NET</Description>
<Version>9.12.5</Version>
<Version>9.12.6</Version>
<PackageTags>json schema validation generator .net</PackageTags>
<Copyright>Copyright © Rico Suter, 2017</Copyright>
<PackageLicenseUrl>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</PackageLicenseUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace NJsonSchema.CodeGeneration.TypeScript.Tests
{
public class ExtensionCodeTests
{
// Important: Line 18 has a \t
private const string Code =
@"/// <reference path=""../../typings/angularjs/angular.d.ts"" />
Expand All @@ -14,7 +15,7 @@ public class ExtensionCodeTests
import 'rxjs/add/operator/map';
export class Bar extends generated.Bar {
get title() {
get title() {
return this.firstName + ' ' + this.lastName;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451</TargetFrameworks>
<Description>JSON Schema reader, generator and validator for .NET</Description>
<Version>9.12.5</Version>
<Version>9.12.6</Version>
<PackageTags>json schema validation generator .net</PackageTags>
<Copyright>Copyright © Rico Suter, 2017</Copyright>
<PackageLicenseUrl>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</PackageLicenseUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public TypeScriptExtensionCode(string code, string[] extendedClasses, string[] b
{
code = code
.Replace("\r", string.Empty)
.Replace("\t", " ")
.Replace("generated.", string.Empty) + "\n";

code = Regex.Replace(code, "(.*?)// ignore(.*?)\\n", string.Empty, RegexOptions.Multiline | RegexOptions.IgnoreCase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net451</TargetFrameworks>
<Description>JSON Schema reader, generator and validator for .NET</Description>
<Version>9.12.5</Version>
<Version>9.12.6</Version>
<PackageTags>json schema validation generator .net</PackageTags>
<Copyright>Copyright © Rico Suter, 2017</Copyright>
<PackageLicenseUrl>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</PackageLicenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
<Description>JSON Schema reader, generator and validator for .NET</Description>
<Version>9.12.5</Version>
<Version>9.12.6</Version>
<PackageTags>json schema validation generator .net</PackageTags>
<Copyright>Copyright © Rico Suter, 2017</Copyright>
<PackageLicenseUrl>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</PackageLicenseUrl>
Expand Down
33 changes: 20 additions & 13 deletions src/NJsonSchema/Generation/JsonSchemaGeneratorSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using NJsonSchema.Infrastructure;
using System.Linq;

#pragma warning disable CS0618 // Type or member is obsolete
namespace NJsonSchema.Generation
{
/// <summary>The JSON Schema generator settings.</summary>
Expand All @@ -27,27 +28,24 @@ public class JsonSchemaGeneratorSettings
/// <summary>Initializes a new instance of the <see cref="JsonSchemaGeneratorSettings"/> class.</summary>
public JsonSchemaGeneratorSettings()
{
DefaultEnumHandling = EnumHandling.Integer;
DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.Null;
DefaultPropertyNameHandling = PropertyNameHandling.Default;
SchemaType = SchemaType.JsonSchema;

// Obsolete, use SerializerSettings instead
DefaultEnumHandling = EnumHandling.Integer;
DefaultPropertyNameHandling = PropertyNameHandling.Default;
ContractResolver = null;

TypeNameGenerator = new DefaultTypeNameGenerator();
SchemaNameGenerator = new DefaultSchemaNameGenerator();
ReflectionService = new DefaultReflectionService();

ExcludedTypeNames = new string[0];
}

/// <summary>Gets or sets the default enum handling (default: Integer).</summary>
public EnumHandling DefaultEnumHandling { get; set; }

/// <summary>Gets or sets the default null handling (if NotNullAttribute and CanBeNullAttribute are missing, default: Null).</summary>
public ReferenceTypeNullHandling DefaultReferenceTypeNullHandling { get; set; }

/// <summary>Gets or sets the default property name handling (default: Default).</summary>
public PropertyNameHandling DefaultPropertyNameHandling { get; set; }

/// <summary>Gets or sets a value indicating whether to generate abstract properties (i.e. interface and abstract properties. Properties may defined multiple times in a inheritance hierarchy, default: false).</summary>
public bool GenerateAbstractProperties { get; set; }

Expand All @@ -70,11 +68,6 @@ public JsonSchemaGeneratorSettings()
/// <summary>Gets or sets the schema type to generate (default: JsonSchema).</summary>
public SchemaType SchemaType { get; set; }

/// <summary>Gets or sets the contract resolver.</summary>
/// <remarks><see cref="DefaultPropertyNameHandling"/> will be ignored.</remarks>
[JsonIgnore]
public IContractResolver ContractResolver { get; set; }

/// <summary>Gets or sets the serializer settings.</summary>
/// <remarks><see cref="DefaultPropertyNameHandling"/>, <see cref="DefaultEnumHandling"/> and <see cref="ContractResolver"/> will be ignored.</remarks>
[JsonIgnore]
Expand Down Expand Up @@ -103,6 +96,20 @@ public JsonSchemaGeneratorSettings()
[JsonIgnore]
public ICollection<ISchemaProcessor> SchemaProcessors { get; } = new Collection<ISchemaProcessor>();

/// <summary>Gets or sets the contract resolver.</summary>
/// <remarks><see cref="DefaultPropertyNameHandling"/> will be ignored.</remarks>
[JsonIgnore]
[Obsolete("Use SerializerSettings directly instead. In NSwag.AspNetCore the property is set automatically.")]
public IContractResolver ContractResolver { get; set; }

/// <summary>Gets or sets the default property name handling (default: Default).</summary>
[Obsolete("Use SerializerSettings directly instead. In NSwag.AspNetCore the property is set automatically.")]
public PropertyNameHandling DefaultPropertyNameHandling { get; set; }

/// <summary>Gets or sets the default enum handling (default: Integer).</summary>
[Obsolete("Use SerializerSettings directly instead. In NSwag.AspNetCore the property is set automatically.")]
public EnumHandling DefaultEnumHandling { get; set; }

/// <summary>Gets the contract resolver.</summary>
/// <returns>The contract resolver.</returns>
/// <exception cref="InvalidOperationException">A setting is misconfigured.</exception>
Expand Down
2 changes: 1 addition & 1 deletion src/NJsonSchema/NJsonSchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard1.0;net40;net45</TargetFrameworks>
<Description>JSON Schema reader, generator and validator for .NET</Description>
<Version>9.12.5</Version>
<Version>9.12.6</Version>
<PackageTags>json schema validation generator .net</PackageTags>
<Copyright>Copyright © Rico Suter, 2017</Copyright>
<PackageLicenseUrl>https://github.com/rsuter/NJsonSchema/blob/master/LICENSE.md</PackageLicenseUrl>
Expand Down

0 comments on commit 2e62595

Please sign in to comment.