From 9cb14aeb8c296cf2731a015f4e0960ddb9ed10c0 Mon Sep 17 00:00:00 2001 From: Tiffany Marrel Date: Tue, 9 May 2023 08:25:14 +0200 Subject: [PATCH] [php] fix documentation of API authorization in README files (#15306) fix hierarchy level + align wording across generators --- .../src/main/resources/php-symfony/README.mustache | 7 ++++--- .../src/main/resources/php/README.mustache | 6 ++---- samples/client/petstore/php/OpenAPIClient-php/README.md | 6 +----- .../petstore/php-symfony/SymfonyBundle-php/README.md | 5 +++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php-symfony/README.mustache b/modules/openapi-generator/src/main/resources/php-symfony/README.mustache index 186feb62732..3e625c77e27 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/README.mustache @@ -147,9 +147,10 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}## {{{name}}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} +{{#authMethods}} +### {{{name}}} {{#isApiKey}}- **Type**: API key - **API key parameter name**: {{{keyParamName}}} diff --git a/modules/openapi-generator/src/main/resources/php/README.mustache b/modules/openapi-generator/src/main/resources/php/README.mustache index 9d68414bf2c..c782ed300fe 100644 --- a/modules/openapi-generator/src/main/resources/php/README.mustache +++ b/modules/openapi-generator/src/main/resources/php/README.mustache @@ -86,11 +86,9 @@ Class | Method | HTTP request | Description {{/models}} ## Authorization -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} {{#authMethods}} -{{#last}} Authentication schemes defined for the API:{{/last}} ### {{{name}}} {{#isApiKey}} diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index b68c5316fdc..64b1639df64 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -167,6 +167,7 @@ Class | Method | HTTP request | Description ## Authorization +Authentication schemes defined for the API: ### petstore_auth - **Type**: `OAuth` @@ -176,7 +177,6 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets - ### api_key - **Type**: API key @@ -184,7 +184,6 @@ Class | Method | HTTP request | Description - **Location**: HTTP header - ### api_key_query - **Type**: API key @@ -192,17 +191,14 @@ Class | Method | HTTP request | Description - **Location**: URL query string - ### http_basic_test - **Type**: HTTP basic authentication - ### bearer_test - **Type**: Bearer authentication (JWT) - ### http_signature_test ## Tests diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md index 949ff0b7a2d..f8349f48d08 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md @@ -153,7 +153,8 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## petstore_auth +Authentication schemes defined for the API: +### petstore_auth - **Type**: OAuth - **Flow**: implicit @@ -162,7 +163,7 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets -## api_key +### api_key - **Type**: API key - **API key parameter name**: api_key