feat(converter): enrich OpenAPI output from Spring annotation slices#70
Conversation
|
Should we merge AppThreat/atom#243 before this PR? Also will atom-tools continue to work with slices without the annotations? |
Yes @prabhu it's dependent PR , donot merge it now I am making some refinements I'll let you know once I am done |
…esponse key
- Add _properties_from_getters() to build request body schema from
argToCalls getter methods when the DTO is absent from userDefinedTypes
- Add _extract_response_dto_key() to derive the response object key from
the actual response DTO class name instead of hard-coding 'description'
- Add _is_custom_dto() to distinguish application DTOs from stdlib types
- Add ±1 line tolerance in _infer_java_response_codes() to handle atom
recording slices at the annotation line vs the method signature line
- Fix OpenAPI title format: '{name} OpenAPI Specification'
@prabhu refinements are done . Please review i think we are good to go . |
a24d4d6 to
fc490f8
Compare
|
Hi @prabhu #72 is the latest PR containing all refinements and changes and its a dependent PR of AppThreat/atom#243 and AppThreat/atom#244 please review #72 . I’m closing PR #71 and #70 since they are no longer up to date. |
Summary
Re-implementation of Spring annotation-driven OpenAPI enrichment,
replacing the previously reverted PRs #67/#68 with a cleaner approach.
What changed
_enrich_from_param_annotation()— first-pass scan ofobjectSlicesfor
PARAM+ANNOTATIONusage pairs. Extracts@RequestBody,@PathVariable,@RequestParam,@RequestHeaderinto proper OpenAPIrequestBodyandparametersobjects._backfill_from_annotation_slices()— second-pass for Spring methodswhere atom omits the HTTP-method annotation from the slice. Correlates
via
x-atom-usagescall line number._build_schema_from_type()— builds an OpenAPI schema from auserDefinedTypesentry, with one-level nested object expansion._java_type_to_schema()— maps 25+ fully-qualified Java types(primitives, collections,
java.time.*,UUID,BigDecimal, etc.)to OpenAPI schema dicts.
merge_params()enrichment — existing entries are now enriched withmissing fields from incoming entries (not just skipped).
Path parameter schema — auto-detected
{param}path variables nowinclude
schema: {type: string}.