Skip to content

Commit

Permalink
set useCollection to defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
atrakic committed Jun 8, 2024
1 parent 046b331 commit 163c060
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand Down
10 changes: 5 additions & 5 deletions Echo.OpenAPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2043
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Echo.OpenAPI", "src\Echo.OpenAPI\Echo.OpenAPI.csproj", "{28CA127C-200D-4F9B-8AF4-2B1D44D71727}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Echo.OpenAPI", "src\Echo.OpenAPI\Echo.OpenAPI.csproj", "{E6D4ED57-2B05-4501-B4B2-9AF40792B7BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{28CA127C-200D-4F9B-8AF4-2B1D44D71727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28CA127C-200D-4F9B-8AF4-2B1D44D71727}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28CA127C-200D-4F9B-8AF4-2B1D44D71727}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28CA127C-200D-4F9B-8AF4-2B1D44D71727}.Release|Any CPU.Build.0 = Release|Any CPU
{E6D4ED57-2B05-4501-B4B2-9AF40792B7BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6D4ED57-2B05-4501-B4B2-9AF40792B7BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6D4ED57-2B05-4501-B4B2-9AF40792B7BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6D4ED57-2B05-4501-B4B2-9AF40792B7BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

all:
all: generate
dotnet restore
dotnet build --configuration Release --no-restore
dotnet test --no-restore --verbosity normal

generate:
./scripts/generate.sh

HELP_ARGS ?= config-help -g aspnetcore

help: ### make help HELP_ARGS=help
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ packageName: Echo.OpenAPI
useDateTimeForDate: true

# Deserialize array types to Collection<T> instead of List<T>. (Default: false)
useCollection: true
# useCollection: true
2 changes: 1 addition & 1 deletion scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ docker run --rm -e CSHARP_POST_PROCESS_FILE=${CSHARP_POST_PROCESS_FILE} -v "${PW
-o /local/"$out"

dos2unix $(find . -type f -exec grep -I -q . {} \; -print)
pre-commit run -a
#pre-commit run -a
2 changes: 1 addition & 1 deletion src/Echo.OpenAPI/Attributes/ValidateModelStateAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Echo.OpenAPI/Authentication/ApiAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down
10 changes: 5 additions & 5 deletions src/Echo.OpenAPI/Controllers/DefaultApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand All @@ -21,13 +21,13 @@
using Echo.OpenAPI.Models;

namespace Echo.OpenAPI.Controllers
{
{
/// <summary>
///
///
/// </summary>
[ApiController]
public class DefaultApiController : ControllerBase
{
{
/// <summary>
/// Search messages
/// </summary>
Expand All @@ -45,7 +45,7 @@ public virtual IActionResult MessagesGet([FromQuery (Name = "query")]string quer
// return StatusCode(200, default(List<Message>));
string exampleJson = null;
exampleJson = "[ {\n \"id\" : 0,\n \"message\" : \"message\"\n}, {\n \"id\" : 0,\n \"message\" : \"message\"\n} ]";

var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Message>>(exampleJson)
: default(List<Message>);
Expand Down
2 changes: 1 addition & 1 deletion src/Echo.OpenAPI/Converters/CustomEnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down
2 changes: 1 addition & 1 deletion src/Echo.OpenAPI/Echo.OpenAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Version>1.0.0</Version>
<AssemblyName>Echo.OpenAPI</AssemblyName>
<PackageId>Echo.OpenAPI</PackageId>
<UserSecretsId>ca94f13f-76ed-41d9-9e2e-c217f7caf605</UserSecretsId>
<UserSecretsId>209e1ede-1abb-4c4e-9c7c-4a448b9b824f</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Echo.OpenAPI/Filters/BasePathFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down
4 changes: 2 additions & 2 deletions src/Echo.OpenAPI/Formatters/InputFormatterStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down Expand Up @@ -42,4 +42,4 @@ protected override bool CanReadType(Type type)
return false;
}
}
}
}
14 changes: 7 additions & 7 deletions src/Echo.OpenAPI/Models/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand All @@ -19,9 +19,9 @@
using Echo.OpenAPI.Converters;

namespace Echo.OpenAPI.Models
{
{
/// <summary>
///
///
/// </summary>
[DataContract]
public partial class Message : IEquatable<Message>
Expand Down Expand Up @@ -85,12 +85,12 @@ public bool Equals(Message other)
if (other is null) return false;
if (ReferenceEquals(this, other)) return true;

return
return
(
Id == other.Id ||

Id.Equals(other.Id)
) &&
) &&
(
VarMessage == other.VarMessage ||
VarMessage != null &&
Expand All @@ -108,7 +108,7 @@ public override int GetHashCode()
{
var hashCode = 41;
// Suitable nullity checks etc, of course :)

hashCode = hashCode * 59 + Id.GetHashCode();
if (VarMessage != null)
hashCode = hashCode * 59 + VarMessage.GetHashCode();
Expand Down
4 changes: 2 additions & 2 deletions src/Echo.OpenAPI/OpenApi/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down Expand Up @@ -58,4 +58,4 @@ public static string FullNameSansTypeParameters(this Type type)
return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex);
}
}
}
}
4 changes: 2 additions & 2 deletions src/Echo.OpenAPI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:61788",
"sslPort": 44301
Expand Down
4 changes: 2 additions & 2 deletions src/Echo.OpenAPI/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A simple API to store and retrieve messages.
*
* The version of the OpenAPI document: 0.0.1
*
*
* Generated by: https://openapi-generator.tech
*/

Expand Down Expand Up @@ -71,7 +71,7 @@ public void ConfigureServices(IServiceCollection services)
.AddSwaggerGen(c =>
{
c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true);

c.SwaggerDoc("0.0.1", new OpenApiInfo
{
Title = "Echo API",
Expand Down

0 comments on commit 163c060

Please sign in to comment.