in src/plugins/parser.ts [70:100]
function parseAlicloudStruct(alicloudStruct: PontSpec.PontJsonSchema, meta: SimpleMeta): PontSpec.PontJsonSchema {
return PontSpec.PontJsonSchema.mapPontxSchema(alicloudStruct, (struct) => {
if (!struct) {
return struct as any as PontSpec.PontJsonSchema;
}
const newStruct = { ...struct };
if (struct.description) {
newStruct.description = parseDescription(struct.description, meta);
}
if (newStruct.$ref) {
const { $ref, ...rest } = newStruct;
const new$ref = $ref?.includes("#/components/schemas/")
? "#/definitions/" + $ref.slice("#/components/schemas/".length)
: $ref;
return {
...rest,
$ref: new$ref,
typeName: new$ref.slice("#/definitions/".length),
isDefsType: true,
} as any;
}
return {
...newStruct,
} as any;
});
}