generator for patch v1 (#46)

This commit is contained in:
Boshi Lian
2018-01-26 13:58:08 +08:00
committed by Brendan Burns
parent 9d263ec5a7
commit 8b1ebbc7a4
3 changed files with 3 additions and 1 deletions

View File

@@ -59,3 +59,4 @@ sed -i '/BaseUri = new System.Uri(\"\");/ d' ${OUTPUT_DIR}/Kubernetes.cs
# remove public prop from Quantity, (autorest cannot generate empty class)
sed -i '/JsonProperty/ d' ${OUTPUT_DIR}/Models/ResourceQuantity.cs
sed -i 's/public string Value/private string Value/' ${OUTPUT_DIR}/Models/ResourceQuantity.cs
sed -i 's/; set/; private set/' ${OUTPUT_DIR}/Models/V1Patch.cs

View File

@@ -46,6 +46,7 @@
<argument>--directive={from: "swagger-document", where: "$..*[?(@.operationId === \"readNamespacedPodLog\")]", transform: "$.responses[\"200\"].schema = { \"type\": \"object\", \"format\": \"file\" }"}</argument>
<argument>--directive={from: "swagger-document", where: "$.definitions", transform: "$[\"intstr.IntOrString\"] = {\"properties\": { \"value\": { \"type\": \"string\" }}}"}</argument>
<argument>--directive={from: "swagger-document", where: "$.definitions", transform: "$[\"resource.Quantity\"] = {\"properties\": { \"value\": { \"type\": \"string\" }}}"}</argument>
<argument>--directive={from: "swagger-document", where: "$.definitions", transform: "$[\"v1.Patch\"] = {\"properties\": { \"content\": { \"type\": \"object\" }}}"}</argument>
<argument>--use=@microsoft.azure/autorest.csharp@preview</argument>
</arguments>
</configuration>

View File

@@ -135,7 +135,7 @@ def preserved_primitives_for_language(client_language):
if client_language == "java":
return ["intstr.IntOrString", "resource.Quantity"]
elif client_language == "csharp":
return ["intstr.IntOrString", "resource.Quantity"]
return ["intstr.IntOrString", "resource.Quantity", "v1.Patch"]
else:
return []