Skip to content

Commit 288ebe9

Browse files
committed
fix operation id with dashes
1 parent 3d6ea16 commit 288ebe9

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [10.6.1] - 2024.02.10
8+
### Fixed
9+
- operationId containing dashes is converted to camel case
10+
711
## [10.6.0] - 2024.01.10
812
### Added
913
- Api key authentication strategy added

src/Input/Factory/OperationFactory.php

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public function create(
4040
$operationId
4141
);
4242
trigger_error($warningMessage, E_USER_WARNING);
43+
} elseif (str_contains($operationId, '-')) {
44+
$operationId = CaseCaster::toCamel($operationId);
4345
}
4446

4547
$parameters = array_merge($commonParameters, $operation->parameters ?? []);

test/suite/functional/Generator/Client/petstore.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ servers:
88
paths:
99
/pets:
1010
get:
11-
operationId: findPets
11+
operationId: find-pets
1212
parameters:
1313
- name: tags
1414
in: query
@@ -110,6 +110,13 @@ paths:
110110
schema:
111111
type: integer
112112
format: int64
113+
- name: food_id
114+
in: path
115+
description: ID of food to delete
116+
required: true
117+
schema:
118+
type: integer
119+
format: int64
113120
responses:
114121
'204':
115122
description: pet food deleted

0 commit comments

Comments
 (0)