Skip to content

Commit

Permalink
fix: Fixed issue with OpenAPI 3.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Aug 28, 2024
1 parent 371df41 commit 76e8e16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/FixOpenApiSpec/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
var text = await File.ReadAllTextAsync(path);

text = text
.Replace(",\"/studio/v1/custom-model/{model_pid}\":{\"delete\":{\"tags\":[\"custom-models\"],\"summary\":\"Delete Model\",\"operationId\":\"v1_delete_custom_model\",\"parameters\":[{\"required\":true,\"schema\":{\"title\":\"Model Pid\",\"type\":\"string\"},\"name\":\"model_pid\",\"in\":\"path\"}],\"responses\":{\"200\":{\"description\":\"Successful Response\",\"content\":{\"application/json\":{\"schema\":{}}}},\"422\":{\"description\":\"Validation Error\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/HTTPValidationError\"}}}}}}}", string.Empty)
.Replace("\"openapi\":\"3.1.0\"", "\"openapi\":\"3.0.1\"")
.Replace(",\"/studio/v1/custom-model/{model_pid}\":{\"delete\":{\"tags\":[\"custom-models\"],\"summary\":\"Delete Model\",\"operationId\":\"v1_delete_custom_model\",\"parameters\":[{\"required\":true,\"schema\":{\"type\":\"string\",\"title\":\"Model Pid\"},\"name\":\"model_pid\",\"in\":\"path\"}],\"responses\":{\"200\":{\"description\":\"Successful Response\",\"content\":{\"application/json\":{\"schema\":{}}}},\"422\":{\"description\":\"Validation Error\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/HTTPValidationError\"}}}}}}}", string.Empty)
;
var openApiDocument = new OpenApiStringReader().Read(text, out var diagnostics);

Expand Down

0 comments on commit 76e8e16

Please sign in to comment.