Skip to content

Commit

Permalink
Merge pull request #43 from myquay/namespace-and-dependencies
Browse files Browse the repository at this point in the history
Namespace and dependencies
  • Loading branch information
myquay authored Jun 22, 2023
2 parents 63d74a4 + 6cafa69 commit 4d882ff
Show file tree
Hide file tree
Showing 63 changed files with 831 additions and 436 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using JsonPatch;
using Microsoft.AspNetCore.Mvc;

namespace JsonPatchCore.Tests.Api.Controllers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using JsonPatchCore;
using JsonPatch;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers()
.AddJsonOptions(options => options.JsonSerializerOptions.Converters.Add(new JsonPatchDocumentJsonConverter()));
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

Expand Down
19 changes: 0 additions & 19 deletions JsonPatch.Common/Constants.cs

This file was deleted.

14 changes: 0 additions & 14 deletions JsonPatch.Common/JsonPatchException.cs

This file was deleted.

17 changes: 0 additions & 17 deletions JsonPatch.Common/JsonPatchOperationType.cs

This file was deleted.

14 changes: 0 additions & 14 deletions JsonPatch.Common/JsonPatchParseException.cs

This file was deleted.

16 changes: 0 additions & 16 deletions JsonPatch.Common/Model/PatchOperation.cs

This file was deleted.

12 changes: 0 additions & 12 deletions JsonPatch.Common/Paths/Components/CollectionIndexPathComponent.cs

This file was deleted.

10 changes: 0 additions & 10 deletions JsonPatch.Common/Paths/Components/CollectionPathComponent.cs

This file was deleted.

12 changes: 0 additions & 12 deletions JsonPatch.Common/Paths/Components/DictionaryPathComponent.cs

This file was deleted.

17 changes: 0 additions & 17 deletions JsonPatch.Common/Paths/Components/PropertyPathComponent.cs

This file was deleted.

11 changes: 0 additions & 11 deletions JsonPatch.Common/Paths/IValueConverter.cs

This file was deleted.

59 changes: 0 additions & 59 deletions JsonPatch.Common/Paths/PathHelper.cs

This file was deleted.

29 changes: 0 additions & 29 deletions JsonPatch.Common/Paths/Resolvers/FlexiblePathResolver.cs

This file was deleted.

18 changes: 0 additions & 18 deletions JsonPatch.Common/Paths/Resolvers/IPathResolver.cs

This file was deleted.

24 changes: 14 additions & 10 deletions JsonPatch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPatchCore", "src\JsonPatchCore\JsonPatchCore.csproj", "{85BC88B3-974A-47B7-9EBF-E6F9A908BD31}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPatch.Common", "JsonPatch.Common\JsonPatch.Common.csproj", "{577D7C0E-32D9-4C88-8C93-74794DAEC76C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPatch.Common", "src\JsonPatch.Common\JsonPatch.Common.csproj", "{C9E7EF1A-8034-454F-9349-610BF69BF91D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonPatchCore.Tests.Api", "src\JsonPatchCore.Tests.Api\JsonPatchCore.Tests.Api.csproj", "{EF766789-277E-4DE9-AFD3-6F4C5170061D}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{E8E53CC8-27DC-4E3A-8B8E-9C95E50D6E7D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{EF573DDA-4BDB-4975-A754-EEDDA2DD840B}"
ProjectSection(SolutionItems) = preProject
Examples\JsonPatchCore.Tests.Api\JsonPatchCore.Tests.Api.csproj = Examples\JsonPatchCore.Tests.Api\JsonPatchCore.Tests.Api.csproj
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -36,18 +41,17 @@ Global
{85BC88B3-974A-47B7-9EBF-E6F9A908BD31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85BC88B3-974A-47B7-9EBF-E6F9A908BD31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85BC88B3-974A-47B7-9EBF-E6F9A908BD31}.Release|Any CPU.Build.0 = Release|Any CPU
{577D7C0E-32D9-4C88-8C93-74794DAEC76C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{577D7C0E-32D9-4C88-8C93-74794DAEC76C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{577D7C0E-32D9-4C88-8C93-74794DAEC76C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{577D7C0E-32D9-4C88-8C93-74794DAEC76C}.Release|Any CPU.Build.0 = Release|Any CPU
{EF766789-277E-4DE9-AFD3-6F4C5170061D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF766789-277E-4DE9-AFD3-6F4C5170061D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF766789-277E-4DE9-AFD3-6F4C5170061D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF766789-277E-4DE9-AFD3-6F4C5170061D}.Release|Any CPU.Build.0 = Release|Any CPU
{C9E7EF1A-8034-454F-9349-610BF69BF91D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9E7EF1A-8034-454F-9349-610BF69BF91D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9E7EF1A-8034-454F-9349-610BF69BF91D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9E7EF1A-8034-454F-9349-610BF69BF91D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A8B44F91-1FF1-41C6-A19B-40700D26AA15} = {E8E53CC8-27DC-4E3A-8B8E-9C95E50D6E7D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B5D5B09B-A34A-4703-B321-A4E5C9FEB814}
EndGlobalSection
Expand Down
41 changes: 41 additions & 0 deletions src/JsonPatch.Common/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JsonPatch
{
/// <summary>
/// Constants
/// </summary>
public static class Constants
{
/// <summary>
/// Operation names
/// </summary>
public static class Operations
{
/// <summary>
/// Adds a value to an object or inserts it into an array.
/// </summary>
public const string ADD = "add";

/// <summary>
/// Removes the element of the array, or member from an object
/// </summary>
public const string REMOVE = "remove";

/// <summary>
/// Replaces a value. Equivalent to a "remove" followed by an "add".
/// </summary>
public const string REPLACE = "replace";

/// <summary>
/// Moves a value from one location to the other.
/// </summary>
public const string MOVE = "move";

}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System;

namespace JsonPatch.Common.Extensions
namespace JsonPatch.Extensions
{
internal static class StringExtensions
{
internal static bool IsPositiveInteger(this string @string)
{
int n;

bool isInteger = Int32.TryParse(@string, out n);
bool isInteger = Int32.TryParse(@string, out int n);

if (!isInteger)
return false;
Expand Down
Loading

0 comments on commit 4d882ff

Please sign in to comment.