-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from DeeJayTC/11-api-from-json
Allow creating APIs via JSON
- Loading branch information
Showing
60 changed files
with
2,760 additions
and
1,196 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
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
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
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,42 @@ | ||
[ | ||
|
||
{ | ||
"name": "MakeJSON", | ||
"route": "/MakeJSON", | ||
"idType": "int", | ||
"Fields": [ | ||
{ | ||
"name": "Name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "Description", | ||
"Type": "string" | ||
|
||
} | ||
] | ||
}, | ||
{ | ||
"name": "CarJSON", | ||
"route": "/CarJSON", | ||
"idType": "int", | ||
"Fields": [ | ||
{ | ||
"name": "Name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "Description", | ||
"Type": "string" | ||
}, | ||
{ | ||
"name": "Make", | ||
"type": "virtual MakeJSON" | ||
}, | ||
{ | ||
"name": "MakeId", | ||
"type": "int" | ||
} | ||
] | ||
} | ||
] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,28 +1,20 @@ | ||
using System; | ||
using System.Text.Json.Serialization; | ||
// TCDev.de 2022/03/24 | ||
// ApiGeneratorSampleApI.MinimalSample.cs | ||
// https://github.com/DeeJayTC/net-dynamic-api | ||
|
||
using TCDev.ApiGenerator.Attributes; | ||
using TCDev.ApiGenerator.Interfaces; | ||
|
||
namespace ApiGeneratorSampleApI.Model | ||
{ | ||
|
||
/// <summary> | ||
/// This is the minimal sample, yes this is a working api ;) | ||
/// This is the minimal sample, yes this is a working api ;) | ||
/// </summary> | ||
[Api("/minimal")] | ||
public class MinimalSample : IObjectBase<int> | ||
{ | ||
public int Id { get; set; } | ||
public string Name { get; set; } | ||
public int Value { get; set; } | ||
} | ||
|
||
[JsonConverter(typeof(JsonStringEnumConverter))] | ||
public enum OperationEnum | ||
{ | ||
INSERT, | ||
UPDATE, | ||
DELETE | ||
} | ||
|
||
[Api("/minimal")] | ||
public class MinimalSample : IObjectBase<int> | ||
{ | ||
public string Name { get; set; } | ||
public int Value { get; set; } | ||
public int Id { get; set; } | ||
} | ||
} |
Oops, something went wrong.