From 0fe1ae13285a8af370f208cf7348a7cf9daa4797 Mon Sep 17 00:00:00 2001 From: WildEgo Date: Sun, 3 Mar 2024 18:40:36 +0000 Subject: [PATCH] fix: Failing tests. --- .../ErrorsResponsesTest__it_adds_auth_error_response__1.yml | 2 ++ ...esTest__it_adds_errors_responses_with_custom_requests__1.yml | 2 ++ ...ErrorsResponsesTest__it_adds_not_found_error_response__1.yml | 2 ++ ...rrorsResponsesTest__it_adds_validation_error_response__1.yml | 2 ++ ...s_validation_error_response_when_documented_in_phpdoc__1.yml | 2 ++ ...validation_error_response_with_facade_made_validators__1.yml | 2 ++ ...ttaches_additional_data_to_the_response_documentation__1.yml | 2 ++ ...DocumentingTest__manually_annotated_responses_support__1.yml | 2 ++ .../ResponseDocumentingTest__multiple_responses_support__1.yml | 2 ++ ...Test__response()-json()_call_support_with_phpdoc_help__1.yml | 2 ++ ...eDocumentingTest__response()-noContent()_call_support__1.yml | 2 ++ ...est__it_extracts_rules_from_Validatormake_facade_call__1.yml | 2 ++ ...ingTest__it_extracts_rules_from_request-validate_call__1.yml | 2 ++ ...cumentingTest__it_supports_manual_authentication_info__1.yml | 2 ++ ...ts_validation_rules_and_form_request_at_the_same_time__1.yml | 2 ++ 15 files changed, 30 insertions(+) diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_auth_error_response__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_auth_error_response__1.yml index d98c7a34..f6f314f2 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_auth_error_response__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_auth_error_response__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: errorsResponsesTest.addsAuthErrorResponse, tags: [ErrorsResponsesTest_], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 403: { $ref: '#/components/responses/AuthorizationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { AuthorizationException: { description: 'Authorization error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Error overview.' } }, required: [message] } } } } } diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_errors_responses_with_custom_requests__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_errors_responses_with_custom_requests__1.yml index 9cc45f79..8d98990a 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_errors_responses_with_custom_requests__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_errors_responses_with_custom_requests__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: errorsResponsesTest.addsErrorsWithCustomRequest, tags: [ErrorsResponsesTest_], parameters: [{ name: foo, in: query, required: true, schema: { type: string } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 422: { $ref: '#/components/responses/ValidationException' }, 403: { $ref: '#/components/responses/AuthorizationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } }, AuthorizationException: { description: 'Authorization error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Error overview.' } }, required: [message] } } } } } diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_not_found_error_response__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_not_found_error_response__1.yml index 2f857fc3..47408651 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_not_found_error_response__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_not_found_error_response__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: '/test/{user}': { get: { operationId: errorsResponsesTest.addsNotFoundErrorResponse, tags: [ErrorsResponsesTest_], parameters: [{ name: user, in: path, required: true, description: 'The user ID', schema: { type: integer } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 404: { $ref: '#/components/responses/ModelNotFoundException' }, 403: { $ref: '#/components/responses/AuthorizationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { ModelNotFoundException: { description: 'Not found', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Error overview.' } }, required: [message] } } } }, AuthorizationException: { description: 'Authorization error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Error overview.' } }, required: [message] } } } } } diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response__1.yml index 9bc8f377..ac8b2259 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: errorsResponsesTest.addsValidationErrorResponse, tags: [ErrorsResponsesTest_], parameters: [{ name: foo, in: query, required: true, schema: { type: string } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 422: { $ref: '#/components/responses/ValidationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } } } diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_when_documented_in_phpdoc__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_when_documented_in_phpdoc__1.yml index 07f6c1ea..d6d25d54 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_when_documented_in_phpdoc__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_when_documented_in_phpdoc__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: errorsResponsesTest.phpdocExceptionResponse, tags: [ErrorsResponsesTest_], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 422: { $ref: '#/components/responses/ValidationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } } } diff --git a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_with_facade_made_validators__1.yml b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_with_facade_made_validators__1.yml index b59687a4..d6986a9b 100644 --- a/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_with_facade_made_validators__1.yml +++ b/tests/__snapshots__/ErrorsResponsesTest__it_adds_validation_error_response_with_facade_made_validators__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: errorsResponsesTest.addsValidationErrorResponseWithFacadeMadeValidators, tags: [ErrorsResponsesTest_], parameters: [{ name: foo, in: query, required: true, schema: { type: string } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 422: { $ref: '#/components/responses/ValidationException' } } } } +tags: + - { name: ErrorsResponsesTest_ } components: responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } } } diff --git a/tests/__snapshots__/ResourceCollectionResponseTest__it_attaches_additional_data_to_the_response_documentation__1.yml b/tests/__snapshots__/ResourceCollectionResponseTest__it_attaches_additional_data_to_the_response_documentation__1.yml index d634f539..daa7cbb6 100644 --- a/tests/__snapshots__/ResourceCollectionResponseTest__it_attaches_additional_data_to_the_response_documentation__1.yml +++ b/tests/__snapshots__/ResourceCollectionResponseTest__it_attaches_additional_data_to_the_response_documentation__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: resourceCollectionResponseTest.index, tags: [ResourceCollectionResponseTest_], responses: { 200: { description: '`UserCollection_One`', content: { application/json: { schema: { type: object, properties: { data: { $ref: '#/components/schemas/UserCollection_One' }, something: { type: object, properties: { foo: { type: string, example: bar } }, required: [foo] } }, required: [data, something] } } } } } } } +tags: + - { name: ResourceCollectionResponseTest_ } components: schemas: { UserCollection_One: { type: object, properties: { foo: { type: string, example: bar }, users: { type: array, items: { $ref: '#/components/schemas/UserResource' } }, meta: { type: object, properties: { foo: { type: string, example: bar } }, required: [foo] } }, required: [foo, users, meta], title: UserCollection_One }, UserResource: { type: object, properties: { id: { type: integer, example: 1 } }, required: [id], title: UserResource } } diff --git a/tests/__snapshots__/ResponseDocumentingTest__manually_annotated_responses_support__1.yml b/tests/__snapshots__/ResponseDocumentingTest__manually_annotated_responses_support__1.yml index 5d02ae5e..682ccee9 100644 --- a/tests/__snapshots__/ResponseDocumentingTest__manually_annotated_responses_support__1.yml +++ b/tests/__snapshots__/ResponseDocumentingTest__manually_annotated_responses_support__1.yml @@ -6,3 +6,5 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: fooTestFour.index, tags: [Foo_TestFour], responses: { 200: { description: 'Simple comment.', content: { application/json: { schema: { type: object, properties: { foo: { type: string, example: bar } }, required: [foo] } } } }, 201: { description: "Advanced comment.\n\nWith more description.", content: { application/json: { schema: { type: object, properties: { foo: { type: string } }, required: [foo] } } } } } } } +tags: + - { name: Foo_TestFour } diff --git a/tests/__snapshots__/ResponseDocumentingTest__multiple_responses_support__1.yml b/tests/__snapshots__/ResponseDocumentingTest__multiple_responses_support__1.yml index 6da3043c..ca9355fd 100644 --- a/tests/__snapshots__/ResponseDocumentingTest__multiple_responses_support__1.yml +++ b/tests/__snapshots__/ResponseDocumentingTest__multiple_responses_support__1.yml @@ -6,3 +6,5 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: fooTestThree.index, tags: [Foo_TestThree], responses: { 200: { description: '', content: { application/json: { schema: { anyOf: [{ type: object, properties: { foo: { type: string, example: bar } }, required: [foo] }, { type: object, properties: { foo: { type: string, example: one } }, required: [foo] }] } } } }, 500: { description: '', content: { application/json: { schema: { type: object, properties: { error: { type: object, properties: { msg: { type: string }, code: { type: integer } }, required: [msg, code] } }, required: [error] } } } } } } } +tags: + - { name: Foo_TestThree } diff --git a/tests/__snapshots__/ResponseDocumentingTest__response()-json()_call_support_with_phpdoc_help__1.yml b/tests/__snapshots__/ResponseDocumentingTest__response()-json()_call_support_with_phpdoc_help__1.yml index 66493b6d..36402174 100644 --- a/tests/__snapshots__/ResponseDocumentingTest__response()-json()_call_support_with_phpdoc_help__1.yml +++ b/tests/__snapshots__/ResponseDocumentingTest__response()-json()_call_support_with_phpdoc_help__1.yml @@ -6,3 +6,5 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: fooTestTwo.index, tags: [Foo_TestTwo], responses: { 500: { description: '', content: { application/json: { schema: { type: object, properties: { error: { type: object, properties: { msg: { type: string }, code: { type: integer } }, required: [msg, code] } }, required: [error] } } } } } } } +tags: + - { name: Foo_TestTwo } diff --git a/tests/__snapshots__/ResponseDocumentingTest__response()-noContent()_call_support__1.yml b/tests/__snapshots__/ResponseDocumentingTest__response()-noContent()_call_support__1.yml index 4d2d24fb..90b2623b 100644 --- a/tests/__snapshots__/ResponseDocumentingTest__response()-noContent()_call_support__1.yml +++ b/tests/__snapshots__/ResponseDocumentingTest__response()-noContent()_call_support__1.yml @@ -6,3 +6,5 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: fooTest.index, tags: [Foo_Test], responses: { 204: { description: 'No content', content: { application/json: { } } } } } } +tags: + - { name: Foo_Test } diff --git a/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_Validatormake_facade_call__1.yml b/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_Validatormake_facade_call__1.yml index 7047ffeb..100f1609 100644 --- a/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_Validatormake_facade_call__1.yml +++ b/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_Validatormake_facade_call__1.yml @@ -6,3 +6,5 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: validationFacadeRulesDocumentingTest.index, tags: [ValidationFacadeRulesDocumenting_Test], parameters: [{ name: content, in: query, required: true, schema: { type: string, enum: [wow] } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } } } } } +tags: + - { name: ValidationFacadeRulesDocumenting_Test } diff --git a/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_request-validate_call__1.yml b/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_request-validate_call__1.yml index 44199831..0c008f24 100644 --- a/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_request-validate_call__1.yml +++ b/tests/__snapshots__/ValidationRulesDocumentingTest__it_extracts_rules_from_request-validate_call__1.yml @@ -6,6 +6,8 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: validationRulesDocumentingTest.index, tags: [ValidationRulesDocumenting_Test], parameters: [{ name: content, in: query, required: true, schema: { type: string, enum: [wow] } }], responses: { 200: { description: '`ValidationRulesDocumenting_TestResource`', content: { application/json: { schema: { type: object, properties: { data: { $ref: '#/components/schemas/ValidationRulesDocumenting_TestResource' } }, required: [data] } } } }, 422: { $ref: '#/components/responses/ValidationException' } } } } +tags: + - { name: ValidationRulesDocumenting_Test } components: schemas: { ValidationRulesDocumenting_TestResource: { type: object, properties: { id: { type: integer, example: 1 } }, required: [id], title: ValidationRulesDocumenting_TestResource } } responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } } } diff --git a/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_manual_authentication_info__1.yml b/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_manual_authentication_info__1.yml index 521c36c0..59971d74 100644 --- a/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_manual_authentication_info__1.yml +++ b/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_manual_authentication_info__1.yml @@ -8,5 +8,7 @@ security: - { apiKey: { } } paths: /test: { get: { operationId: controllerWithoutSecurity.index, tags: [WithoutSecurity], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } } }, security: [{ }] } } +tags: + - { name: WithoutSecurity } components: securitySchemes: { apiKey: { type: apiKey, in: query, name: api_token } } diff --git a/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_validation_rules_and_form_request_at_the_same_time__1.yml b/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_validation_rules_and_form_request_at_the_same_time__1.yml index 4297c3c8..f357235e 100644 --- a/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_validation_rules_and_form_request_at_the_same_time__1.yml +++ b/tests/__snapshots__/ValidationRulesDocumentingTest__it_supports_validation_rules_and_form_request_at_the_same_time__1.yml @@ -6,5 +6,7 @@ servers: - { url: 'http://localhost/api' } paths: /test: { get: { operationId: validationRulesAndFormRequestAtTheSameTimeTest.index, tags: [ValidationRulesAndFormRequestAtTheSameTime_Test], parameters: [{ name: from_form_request, in: query, schema: { type: integer } }, { name: from_validate_call, in: query, required: true, schema: { type: string } }], responses: { 200: { description: '', content: { application/json: { schema: { type: string } } } }, 422: { $ref: '#/components/responses/ValidationException' } } } } +tags: + - { name: ValidationRulesAndFormRequestAtTheSameTime_Test } components: responses: { ValidationException: { description: 'Validation error', content: { application/json: { schema: { type: object, properties: { message: { type: string, description: 'Errors overview.' }, errors: { type: object, description: 'A detailed description of each field that failed validation.', additionalProperties: { type: array, items: { type: string } } } }, required: [message, errors] } } } } }