Skip to content

Commit 9cb14ae

Browse files
authored
[php] fix documentation of API authorization in README files (#15306)
fix hierarchy level + align wording across generators
1 parent 4deaad5 commit 9cb14ae

4 files changed

Lines changed: 10 additions & 14 deletions

File tree

modules/openapi-generator/src/main/resources/php-symfony/README.mustache

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ Class | Method | HTTP request | Description
147147

148148
## Documentation For Authorization
149149

150-
{{^authMethods}} All endpoints do not require authorization.
151-
{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}}
152-
{{#authMethods}}## {{{name}}}
150+
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
151+
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
152+
{{#authMethods}}
153+
### {{{name}}}
153154

154155
{{#isApiKey}}- **Type**: API key
155156
- **API key parameter name**: {{{keyParamName}}}

modules/openapi-generator/src/main/resources/php/README.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,9 @@ Class | Method | HTTP request | Description
8686
{{/models}}
8787

8888
## Authorization
89-
{{^authMethods}}
90-
All endpoints do not require authorization.
91-
{{/authMethods}}
89+
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
90+
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
9291
{{#authMethods}}
93-
{{#last}} Authentication schemes defined for the API:{{/last}}
9492
### {{{name}}}
9593
{{#isApiKey}}
9694

samples/client/petstore/php/OpenAPIClient-php/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Class | Method | HTTP request | Description
167167

168168
## Authorization
169169

170+
Authentication schemes defined for the API:
170171
### petstore_auth
171172

172173
- **Type**: `OAuth`
@@ -176,33 +177,28 @@ Class | Method | HTTP request | Description
176177
- **write:pets**: modify pets in your account
177178
- **read:pets**: read your pets
178179

179-
180180
### api_key
181181

182182
- **Type**: API key
183183
- **API key parameter name**: api_key
184184
- **Location**: HTTP header
185185

186186

187-
188187
### api_key_query
189188

190189
- **Type**: API key
191190
- **API key parameter name**: api_key_query
192191
- **Location**: URL query string
193192

194193

195-
196194
### http_basic_test
197195

198196
- **Type**: HTTP basic authentication
199197

200-
201198
### bearer_test
202199

203200
- **Type**: Bearer authentication (JWT)
204201

205-
206202
### http_signature_test
207203

208204
## Tests

samples/server/petstore/php-symfony/SymfonyBundle-php/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ Class | Method | HTTP request | Description
153153
## Documentation For Authorization
154154

155155

156-
## petstore_auth
156+
Authentication schemes defined for the API:
157+
### petstore_auth
157158

158159
- **Type**: OAuth
159160
- **Flow**: implicit
@@ -162,7 +163,7 @@ Class | Method | HTTP request | Description
162163
- **write:pets**: modify pets in your account
163164
- **read:pets**: read your pets
164165

165-
## api_key
166+
### api_key
166167

167168
- **Type**: API key
168169
- **API key parameter name**: api_key

0 commit comments

Comments
 (0)