11import getContentSchema from "./content" ;
22import resolveEndpoints from "./enpoint" ;
33import { defaultOperationName } from "./operation-name" ;
4- import { resolveOperationParams } from "./operation-param" ;
4+ import { resolveDocParams , resolveOperationParams } from "./operation-param" ;
55import { getResponse } from "./response" ;
66import { resolveSchema } from "./schema-definition" ;
77import type { PathsObject } from "@omer-x/openapi-types/paths" ;
88import type { ResponsesObject } from "@omer-x/openapi-types/response" ;
99
1010export type DeclaredOperation = {
1111 name : string ,
12+ desription : string ,
1213 parameters : string ,
14+ docParams : {
15+ name : string ,
16+ type : string ,
17+ description : string ,
18+ } [ ] ,
1319 result : string ,
1420} ;
1521
1622function resolveOperationResult ( responses ?: ResponsesObject ) {
1723 if ( ! responses ) return "unknown" ;
1824 const schemas = Object . values ( responses ) . map ( resp => {
19- if ( ! resp ) return null ;
2025 const response = getResponse ( resp ) ;
2126 if ( ! response . content ) return null ;
2227 const schema = getContentSchema ( response . content ) ;
@@ -29,7 +34,9 @@ function resolveOperationResult(responses?: ResponsesObject) {
2934export function resolveDeclaredOperations ( paths : PathsObject , framework : string | null ) {
3035 return resolveEndpoints ( paths ) . map < DeclaredOperation > ( ( { method, path, operation } ) => ( {
3136 name : operation . operationId || defaultOperationName ( method , path ) ,
37+ desription : operation . description || "missing-description" ,
3238 parameters : resolveOperationParams ( operation , method , true , framework ) . join ( ", " ) ,
39+ docParams : resolveDocParams ( operation , method , framework ) ,
3340 result : resolveOperationResult ( operation . responses ) ,
3441 } ) ) ;
3542}
0 commit comments