Skip to content

Commit

Permalink
Update OpenApiContractGenerator.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Oct 4, 2024
1 parent 434d203 commit 20f61d3
Showing 1 changed file with 3 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ string GenerateObject(OpenApiSchema schema, string className)
if (typeName != null)
{
// throw new InvalidOperationException("TypeName is null");
sb.AppendLine($" [System.Text.Json.Serialization.JsonPropertyName(\"{prop.Key}\")]");
sb.AppendLine(" public " + typeName + " " + propertyName + " { get; set; }");
sb.AppendLine($" [global::System.Text.Json.Serialization.JsonPropertyName(\"{prop.Key}\")]");
sb.AppendLine( " public " + typeName + " " + propertyName + " { get; set; }");
sb.AppendLine();
output($"PROPERTY: {propertyName} ({typeName})");
}
Expand All @@ -334,40 +334,4 @@ string GenerateObject(OpenApiSchema schema, string className)
output("===DONE GENERATING CLASS COMPONENT: " + className);
return sb.ToString();
}
}


// TODO: properties within properties
/*
properties:
STANDBY:
type: object
properties:
waitTime:
type: number
SINGLE_RIDER:
type: object
properties:
waitTime:
type: number
nullable: true
required:
- waitTime
RETURN_TIME:
type: object
properties:
state:
$ref: '#/components/schemas/ReturnTimeState'
returnStart:
type: string
format: date-time
nullable: true
returnEnd:
type: string
format: date-time
nullable: true
required:
- state
- returnStart
- returnEnd
*/
}

0 comments on commit 20f61d3

Please sign in to comment.