-
Notifications
You must be signed in to change notification settings - Fork 48
163 modify 500 code error response page #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…hub.com/RonasIT/laravel-swagger into 163-modify-500-code-error-response-page
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the error response page formatting for Swagger validation errors, addressing issue #163. The changes enhance error presentation with structured markdown formatting and proper error context display.
- Reformats error page display with markdown structure including headers and visual separators
- Updates error handling to include exception type information alongside error messages
- Fixes test parameter ordering and adds new test case for incorrect documentation structure
Reviewed Changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/views/error.blade.php | Updates error page template with structured markdown formatting |
| src/Services/SwaggerService.php | Modifies exception handling to capture and pass exception type information |
| tests/SwaggerServiceTest.php | Updates test expectations and adds new test case for documentation structure errors |
| tests/TestCase.php | Fixes parameter order in exportContent method call |
| tests/fixtures/SwaggerServiceTest/*.html | Updates all error fixture files to match new markdown-formatted error template |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@RGO230 please review copilot's comments and increase test coverage |
…hub.com/RonasIT/laravel-swagger into 163-modify-500-code-error-response-page
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 62 out of 64 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| public function testGetInvalidJsonDocumentation(): void | ||
| { | ||
| $this->disk->put(self::$productionFilePath, $this->getFixturePath('invalid_prod_json_data')); |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using getFixturePath() incorrectly - this returns a file path string, not file content. Should use $this->getFixture('invalid_prod_json_data.json') to write the actual fixture content to the storage disk.
| $this->disk->put(self::$productionFilePath, $this->getFixturePath('invalid_prod_json_data')); | |
| $this->disk->put(self::$productionFilePath, $this->getFixture('invalid_prod_json_data.json')); |
|
|
||
| protected function assertExceptionHTMLEqualsFixture(string $fixture, string $content, bool $exportMode = false): void | ||
| { | ||
| $content = Str::replaceMatches('/line=\d+,/', 'line=999, ', $content); |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex pattern /line=\d+,/ matches 'line=123,' but the replacement is 'line=999, ' (with an extra space after the comma). This creates inconsistent spacing. The replacement should be 'line=999,' to maintain consistent formatting.
| $prodDocPath = "tests/fixtures/SwaggerServiceTest/{$prodDoc}.json"; | ||
|
|
||
| file_put_contents($productionFilePath, file_get_contents($prodDocPath)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will it works the same?
| $prodDocPath = "tests/fixtures/SwaggerServiceTest/{$prodDoc}.json"; | |
| file_put_contents($productionFilePath, file_get_contents($prodDocPath)); | |
| $documentation = $this->getJsonFixture($prodDoc); | |
| file_put_contents($productionFilePath, $documentation); |
|
|
||
| $fileContent = json_decode(file_get_contents($filePath), true); | ||
|
|
||
| if (empty($fileContent)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you remove it? The additional documentation may not be exists by the path set in the config and it good to throw an error in this case
|
|
||
| public function testGetInvalidJsonDocumentation(): void | ||
| { | ||
| file_put_contents(self::$productionFilePath, $this->getFixturePath('invalid_prod_json_data')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| file_put_contents(self::$productionFilePath, $this->getFixturePath('invalid_prod_json_data')); | |
| file_put_contents(self::$productionFilePath, $this->getFixture('invalid_prod_json_data')); |



#163