From 4893c9bd9d39313b7717ced3201fd977c57f8072 Mon Sep 17 00:00:00 2001 From: Freek van Rijt Date: Tue, 9 Apr 2024 12:52:59 +0200 Subject: [PATCH] feat(open-api): add display of request parameter and body information INT-407 --- .../client/components/global/OpenApiPath.vue | 28 +++- .../components/global/OpenApiRequestParam.vue | 131 ++++++++++++++++++ .../components/global/OpenApiSchema.vue | 4 +- .../components/global/OpenApiSchemaInfo.vue | 6 +- 4 files changed, 162 insertions(+), 7 deletions(-) create mode 100644 src/.vuepress/theme/client/components/global/OpenApiRequestParam.vue diff --git a/src/.vuepress/theme/client/components/global/OpenApiPath.vue b/src/.vuepress/theme/client/components/global/OpenApiPath.vue index 4760625d..8d3209d0 100644 --- a/src/.vuepress/theme/client/components/global/OpenApiPath.vue +++ b/src/.vuepress/theme/client/components/global/OpenApiPath.vue @@ -17,7 +17,26 @@

{{ operation.description }}

- + + import {type OpenAPIV3_1 as OpenApiType} from 'openapi-types'; import OpenApiResponses from './OpenApiResponses.vue'; +import OpenApiRequestParam from './OpenApiRequestParam.vue'; import OpenApiOperation from './OpenApiOperation.vue'; defineProps<{ title: string; path: OpenApiType.PathItemObject; }>(); + +function isParameterType( + parameter: OpenApiType.ParameterObject | OpenApiType.ReferenceObject, +): parameter is OpenApiType.ParameterObject { + return 'in' in parameter && 'schema' in parameter; +} diff --git a/src/.vuepress/theme/client/components/global/OpenApiRequestParam.vue b/src/.vuepress/theme/client/components/global/OpenApiRequestParam.vue new file mode 100644 index 00000000..11e1bef2 --- /dev/null +++ b/src/.vuepress/theme/client/components/global/OpenApiRequestParam.vue @@ -0,0 +1,131 @@ + + + diff --git a/src/.vuepress/theme/client/components/global/OpenApiSchema.vue b/src/.vuepress/theme/client/components/global/OpenApiSchema.vue index c8e5216e..6f279b62 100644 --- a/src/.vuepress/theme/client/components/global/OpenApiSchema.vue +++ b/src/.vuepress/theme/client/components/global/OpenApiSchema.vue @@ -1,7 +1,5 @@