( typeName: string, paramsSchema: JSONSchema7, )
| 1429 | const schemaPropertyNames = (schema: JSONSchema7): string[] => |
| 1430 | sortedNames(Object.keys(schema.properties ?? {})); |
| 1431 | const shouldPreferMethodParamSchema = ( |
| 1432 | typeName: string, |
| 1433 | paramsSchema: JSONSchema7, |
| 1434 | ): boolean => { |
| 1435 | const definition = definitions[typeName]; |
| 1436 | if (typeof definition !== "object" || definition === null) return false; |
| 1437 | const definitionSchema = asGeneratedObjectSchema( |
| 1438 | definition as JSONSchema7, |
| 1439 | defCollections, |
| 1440 | ); |
| 1441 | if (!definitionSchema) return false; |
| 1442 | |
| 1443 | return ( |
| 1444 | JSON.stringify(schemaPropertyNames(paramsSchema)) !== |
| 1445 | JSON.stringify(schemaPropertyNames(definitionSchema)) || |
| 1446 | JSON.stringify(sortedNames(paramsSchema.required)) !== |
| 1447 | JSON.stringify(sortedNames(definitionSchema.required)) |
| 1448 | ); |
| 1449 | }; |
| 1450 | for (const { method, isSession } of methodEntries) { |
| 1451 | const params = method.params as (JSONSchema7 & { $ref?: string }) | undefined; |
| 1452 | if (!params || typeof params.$ref === "string") continue; |
no test coverage detected
searching dependent graphs…