astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)
openapi-zod-client.vercel.app
717 stars 80 forks source link

uri ref is broken, if property name is "MyGeneric<Temp>" then ref is "MyGeneric%3CTemp%3E" and it's not resolved. #293

Open NikitaFedorov1 opened 2 months ago

NikitaFedorov1 commented 2 months ago
#/components/schemas/api/properties/MyGeneric%3Calias-_index.d.ts-541-729-_index.d.ts-0-1797420362607%3E not found

    // actual: 
    // map["MyGeneric%3CTemp%3E"]
    // expected:
    // map["MyGeneric<Temp>"]
    return map[name]; 

current:

var autocorrectRef = function autocorrectRef(ref) {
  return decodeURI(ref[1] === "/" ? ref : "#/" + ref.slice(1));
};

should be like:

var autocorrectRef = function autocorrectRef(ref) {
  return decodeURI(ref[1] === "/" ? ref : "#/" + ref.slice(1));
};

And nested refs ain't resolved:

Error: Schema #/components/schemas/consolidation/properties/Command not found