Cognitivegears/issue14#29
Open
cognitivegears wants to merge 9 commits into
Open
Conversation
Changes to make Java work on M4 mac Added JSON schema generator Added unit testing and some refactoring Changes to generate body schema Make devcontainer work with docker desktop Refactoring part 1 Added Lombok Refactored and cleaned up
There was a problem hiding this comment.
Pull Request Overview
This PR introduces large-scale changes to support JSON Schema generation and enhances test coverage for the Modsecurity3 generator. Key changes include:
- New and expanded unit tests for model processing, JSON schema type mapping, and generator operations.
- New services and utility classes for JSON Schema generation, configuration, and pattern generation.
- Updates to CI/CD pipelines and documentation for testing and integration.
Reviewed Changes
Copilot reviewed 36 out of 41 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/java/com/oashield/openapi/generators/modsecurity3/tests/ModelProcessingTest.java | New tests verifying JSON Schema generation and model properties. |
| src/test/java/com/oashield/openapi/generators/modsecurity3/tests/JsonSchemaTypeMapperTest.java | Added tests for case-insensitive type mapping and default behaviors. |
| src/main/java/com/oashield/openapi/generators/modsecurity3/(TemplateManager, PatternGenerationService, OperationProcessor, ModelProcessor, JsonSchemaGenerator, ConfigurationManager) | New service classes for JSON Schema generation, processing operations/models, template management, and configuration. |
| README.md & .github/workflows/*.yml | Updated documentation and CI workflow definitions for unit and integration tests. |
Files not reviewed (5)
- .devcontainer/devcontainer.json: Language not supported
- .vscode/settings.json: Language not supported
- pom.xml: Language not supported
- src/main/resources/modsecurity3/config.mustache: Language not supported
- src/main/resources/modsecurity3/mainconfig.mustache: Language not supported
Comments suppressed due to low confidence (1)
src/test/java/com/oashield/openapi/generators/modsecurity3/tests/ModelProcessingTest.java:75
- The error message for checking the 'tags' property is misleading. Consider updating it to 'Pet model should have tags property' to better reflect the context.
assertTrue(petProperties.has("tags"), "Tag model should be included");
| * @param baseNamePrefix The prefix to add to the property name | ||
| * @return A list of flattened properties | ||
| */ | ||
| public List<CodegenProperty> flattenModel(CodegenProperty currentProperty, String baseNamePrefix) { |
There was a problem hiding this comment.
A similar flattenModel method is also implemented in ModelProcessor. Consider refactoring to a common utility to reduce duplication and improve maintainability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Large scale changes for supporting JSON schema and additional test changes.