Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Fix(Generation): Lowercased all properties
Browse files Browse the repository at this point in the history
  • Loading branch information
DAHAG-ArisNourbakhsh committed Jun 27, 2022
1 parent f04b626 commit cf02101
Show file tree
Hide file tree
Showing 5 changed files with 3,142 additions and 3,135 deletions.
9 changes: 8 additions & 1 deletion Dahag.Keycloak.OpenApiGenerator/OpenApiHelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,20 @@ public static OpenApiMediaType ToOpenApiMediaType(this TypeInfo typeInfo)

public static OpenApiSchema ToOpenApiSchema(this IRepresentation representation)
{

return new OpenApiSchema
{
Type = "object",
Properties = representation.Properties.ToDictionary(property => property.Name, property => property.Type.ToOpenApiSchema())
Properties = representation.Properties.ToDictionary(ToLowerPascalCase, property => property.Type.ToOpenApiSchema())
};
}

private static string ToLowerPascalCase(Property property)
{
var name = char.ToLower(property.Name[0]) + property.Name[1..];
return name;
}

public static OpenApiSchema ToOpenApiSchema(this TypeInfo typeInfo)
{
if (typeInfo.Primitive != null)
Expand Down
Loading

0 comments on commit cf02101

Please sign in to comment.