Skip to content

feat(parser): add plugin-based parser strategies with ruamel-yaml support#1

Merged
frantuma merged 1 commit intomainfrom
feat/strategies-design
Sep 17, 2025
Merged

feat(parser): add plugin-based parser strategies with ruamel-yaml support#1
frantuma merged 1 commit intomainfrom
feat/strategies-design

Conversation

@frantuma
Copy link
Collaborator

Add comprehensive plugin architecture for OpenAPI parsing with multiple strategy support:

  • Add BaseParserStrategy interface for extensible parsing strategies
  • Implement DefaultOpenAPIParser, RuamelOpenAPIParser, and RuamelRoundTripOpenAPIParser strategies
  • Add plugin discovery system using importlib.metadata entry points
  • Support multiple parser strategies with last-successful-wins semantics
  • Add ruamel-yaml dependency for enhanced YAML parsing capabilities
  • Enhance OpenAPIParser with overloaded parse method supporting custom return types
  • Export load_uri function for external URI loading functionality

The parser now supports strategy-based parsing allowing users to choose between different parsing backends and enabling third-party extensions through the plugin system. This provides better flexibility for handling different YAML/JSON parsing requirements while maintaining backward compatibility.

BREAKING CHANGE: OpenAPIParser constructor now accepts strategies parameter, changing the default initialization behavior. The parse method signature has been enhanced with optional return_type and strict parameters.

@frantuma frantuma requested a review from char0n September 15, 2025 20:57
@frantuma frantuma force-pushed the feat/strategies-design branch from 1a6ea86 to c8744ae Compare September 15, 2025 21:20
…port

Add comprehensive plugin architecture for OpenAPI parsing with multiple strategy support:

- Add BaseParserStrategy interface for extensible parsing strategies
- Implement DefaultOpenAPIParser, RuamelOpenAPIParser, and RuamelRoundTripOpenAPIParser strategies
- Add plugin discovery system using importlib.metadata entry points
- Support multiple parser strategies with last-successful-wins semantics
- Add ruamel-yaml dependency for enhanced YAML parsing capabilities
- Enhance OpenAPIParser with overloaded parse method supporting custom return types
- Export load_uri function for external URI loading functionality
- Add comprehensive URI resolution with HTTP/HTTPS, file://, and local path support
- Implement proper error handling with UriResolutionError for resolution failures

The parser now supports strategy-based parsing allowing users to choose between different
parsing backends and enabling third-party extensions through the plugin system. This
provides better flexibility for handling different YAML/JSON parsing requirements while
maintaining backward compatibility.

BREAKING CHANGE: OpenAPIParser constructor now accepts strategies parameter, changing
the default initialization behavior. The parse method signature has been enhanced with
optional return_type and strict parameters.
@frantuma frantuma force-pushed the feat/strategies-design branch from c8744ae to 8c8ad7a Compare September 17, 2025 14:47
@frantuma frantuma merged commit cfa5d68 into main Sep 17, 2025
10 checks passed
@frantuma frantuma deleted the feat/strategies-design branch September 17, 2025 14:50
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