Skip to content

Commit b990437

Browse files
committed
fix(openapi): correct openapi errors
1 parent 344f91a commit b990437

7 files changed

Lines changed: 385 additions & 7 deletions

File tree

.redocly.lint-ignore.yaml

Lines changed: 374 additions & 0 deletions
Large diffs are not rendered by default.

tests/Fixtures/TestBundle/ApiResource/DummyWebhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use ApiPlatform\OpenApi\Model\PathItem;
2222

2323
#[ApiResource(operations: [new Get(openapi: new Webhook(
24-
name: 'a',
24+
name: 'a/{id}',
2525
pathItem: new PathItem(
2626
get: new Operation(
2727
summary: 'Something else here',

tests/Fixtures/TestBundle/Entity/Issue6041/NumericValidated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ class NumericValidated
3939
#[ORM\Column]
4040
public int $greaterThanMe;
4141

42-
#[Assert\GreaterThanOrEqual(value: '10.99')]
42+
#[Assert\GreaterThanOrEqual(value: 10.99)]
4343
#[ORM\Column]
4444
public float $greaterThanOrEqualToMe;
4545

4646
#[Assert\LessThan(value: 99)]
4747
#[ORM\Column]
4848
public int $lessThanMe;
4949

50-
#[Assert\LessThanOrEqual(value: '99.33')]
50+
#[Assert\LessThanOrEqual(value: 99.33)]
5151
#[ORM\Column]
5252
public float $lessThanOrEqualToMe;
5353

tests/Fixtures/TestBundle/Entity/Issue7135/Foo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
shortName: 'FooPr7135',
2424
operations: [
2525
new Post(
26-
uriTemplate: '/pull-request-7135/foo/',
26+
uriTemplate: '/pull-request-7135/foo',
2727
),
2828
],
2929
normalizationContext: ['iri_only' => true],

tests/Fixtures/app/ruleset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ rules:
99
component-description: false
1010
paths-kebab-case: false
1111
no-unnecessary-combinator: false
12+
oas-missing-type: false
13+
oas3-unused-component: false
14+
operation-tags: false
15+
oas3-api-servers: false

tests/Functional/Issues/Issue7135Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testValidPostRequestWithIriWhenIdentifierIsUuid(): void
4747
$this->recreateSchema(self::getResources());
4848
$bar = $this->loadBarFixture();
4949

50-
$response = self::createClient()->request('POST', '/pull-request-7135/foo/', [
50+
$response = self::createClient()->request('POST', '/pull-request-7135/foo', [
5151
'json' => [
5252
'bar' => 'pull-request-7135/bar/'.$bar->id,
5353
],
@@ -63,7 +63,7 @@ public function testInvalidPostRequestWithIriWhenIdentifierIsUuid(): void
6363
$this->markTestSkipped();
6464
}
6565

66-
$response = self::createClient()->request('POST', '/pull-request-7135/foo/', [
66+
$response = self::createClient()->request('POST', '/pull-request-7135/foo', [
6767
'json' => [
6868
'bar' => 'pull-request-7135/bar/invalid-uuid',
6969
],

tests/Functional/OpenApiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function testRetrieveTheOpenApiDocumentation(): void
357357
$this->assertSame('Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: foobar[]={propertyName}&foobar[]={anotherPropertyName}&foobar[{nestedPropertyParent}][]={nestedProperty}', $json['paths']['/dummy_cars']['get']['parameters'][9]['description']);
358358

359359
// Webhook
360-
$this->assertSame('Something else here for example', $json['webhooks']['a']['get']['description']);
360+
$this->assertSame('Something else here for example', $json['webhooks']['a/{id}']['get']['description']);
361361
$this->assertSame('Hi! it\'s me, I\'m the problem, it\'s me', $json['webhooks']['b']['post']['description']);
362362

363363
// Subcollection - check filter on subResource

0 commit comments

Comments
 (0)