Skip to content

fix: enhance JSON5 parsing error handling in RouterParserUtil#1611

Merged
tcorral merged 5 commits intodevelopfrom
fix/#1610
Aug 29, 2025
Merged

fix: enhance JSON5 parsing error handling in RouterParserUtil#1611
tcorral merged 5 commits intodevelopfrom
fix/#1610

Conversation

@tcorral
Copy link
Collaborator

@tcorral tcorral commented Aug 28, 2025

  • Added error handling for JSON5 parsing in the cleanRawRouteParsed method to log detailed error messages when parsing fails due to special characters in file paths or route configurations.
  • Improved the cleanRawRoute method to handle unescaped characters and malformed string concatenations that could lead to parsing issues.
  • Introduced a new test suite to validate the handling of routes with special characters, ensuring that documentation generation does not fail due to these issues.

We do expect these changes to fix all the JSON5 parsing errors: #1610 , #1594 , #1581 , #1573 #1550 and #1533

- Added error handling for JSON5 parsing in the cleanRawRouteParsed method to log detailed error messages when parsing fails due to special characters in file paths or route configurations.
- Improved the cleanRawRoute method to handle unescaped characters and malformed string concatenations that could lead to parsing issues.
- Introduced a new test suite to validate the handling of routes with special characters, ensuring that documentation generation does not fail due to these issues.

We do expect these changes to fix all the JSON5 parsing errors: #1610, #1594, #1581, #1573 and #1550
@tcorral tcorral requested a review from vogloblinsky August 28, 2025 14:11
@tcorral
Copy link
Collaborator Author

tcorral commented Aug 28, 2025

@vogloblinsky Could you help with the false positive? https://sonarcloud.io/project/security_hotspots?sinceLeakPeriod=true&pullRequest=1611&id=compodoc_compodoc I cannot set them as safe.

…RouterParserUtil

- Enhanced the RouterParserUtil to correctly parse template literals and fix issues with malformed string concatenations.
- Updated tests to validate the handling of new template literal routes and ensure that JSON5 parsing errors are properly managed.
- Ensured that the application does not crash with complex character combinations in routes, addressing new edge cases.

These changes aim to resolve additional parsing issues related to template literals and improve overall robustness in route handling.
@vogloblinsky
Copy link
Contributor

@vogloblinsky Could you help with the false positive? https://sonarcloud.io/project/security_hotspots?sinceLeakPeriod=true&pullRequest=1611&id=compodoc_compodoc I cannot set them as safe.

I just mark them as safe

Copy link
Contributor

@vogloblinsky vogloblinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks for the work

tomas_backbase added 3 commits August 29, 2025 15:28
- Updated the route rendering logic to handle cases where the component name is not provided, defaulting to the path or name.
- Added conditional checks to display the component name when it includes 'Component' for better clarity in the output.
- Enhanced the overall robustness of the route display by ensuring that both path and name are utilized effectively.

These changes aim to improve the user experience by providing clearer route information in the application.
…for application

- Introduced a new routing module (AppRoutingModule) to manage application routes, including dynamic and nested routes.
- Created constants for route paths and types to enhance route management and clarity.
- Added utility functions for lazy loading modules and route configuration.
- Established a basic application module (AppModule) to bootstrap the application with routing capabilities.
- Included a TypeScript configuration file for improved type checking and compilation settings.

These changes lay the groundwork for a structured routing system, improving navigation and modularity within the application.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@tcorral tcorral marked this pull request as ready for review August 29, 2025 14:40
@tcorral tcorral merged commit 8e048e2 into develop Aug 29, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants