Skip to content

Conversation

@cognitivegears
Copy link
Owner

Large scale changes for supporting JSON schema and additional test changes.

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
@cognitivegears cognitivegears requested a review from Copilot May 2, 2025 02:33
Copy link

Copilot AI left a 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 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) {
Copy link

Copilot AI May 2, 2025

Choose a reason for hiding this comment

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

A similar flattenModel method is also implemented in ModelProcessor. Consider refactoring to a common utility to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
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