libninja icon indicating copy to clipboard operation
libninja copied to clipboard

libninja consider a route without a successful response code is invalid

Open Octopus773 opened this issue 8 months ago • 1 comments

libninja consider a route without a successful response code is invalid

thread 'main' panicked at libninja/src/extractor/operation.rs:188:9:
No success response for operation Operation { tags: ["LiveTv"], summary: Some("Get recording group."), description: None, external_docs: None, operation_id: Some("GetRecordingGroup"), parameters: [Item(Parameter { data: ParameterData { name: "groupId", description: Some("Group id."), required: true, deprecated: None, format: Schema(Item(Schema { data: SchemaData { nullable: false, read_only: false, write_only: false, deprecated: false, external_docs: None, example: None, title: None, description: None, discriminator: None, default: None, extensions: {} }, kind: Type(String(StringType { format: Unknown("uuid"), pattern: None, enumeration: [], min_length: None, max_length: None })) })), example: None, examples: {}, explode: None, extensions: {} }, kind: Path { style: Simple } })], request_body: None, responses: Responses { default: None, responses: {Code(404): Item(Response { description: "Not Found", headers: {}, content: {"application/json": MediaType { schema: Some(Reference { reference: "#/components/schemas/ProblemDetails" }), example: None, examples: {}, encoding: {}, extensions: {} }, "application/json; profile=\"CamelCase\"": MediaType { schema: Some(Reference { reference: "#/components/schemas/ProblemDetails" }), example: None, examples: {}, encoding: {}, extensions: {} }, "application/json; profile=\"PascalCase\"": MediaType { schema: Some(Reference { reference: "#/components/schemas/ProblemDetails" }), example: None, examples: {}, encoding: {}, extensions: {} }}, links: {}, extensions: {} }), Code(401): Item(Response { description: "Unauthorized", headers: {}, content: {}, links: {}, extensions: {} }), Code(403): Item(Response { description: "Forbidden", headers: {}, content: {}, links: {}, extensions: {} })}, extensions: {} }, deprecated: true, security: Some([{"CustomAuthentication": ["LiveTvAccess", "DefaultAuthorization"]}]), servers: [], extensions: {} }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

However, this is used by the Jellyfin API for some deprecated routes https://api.jellyfin.org/#tag/LiveTv/operation/GetRecordingGroup Image

Maybe ignore the route with a console warning on such cases or generate a function that directly give an error

Octopus773 avatar May 01 '25 23:05 Octopus773

I welcome PRs but realistically don't have time to look at this myself.

kurtbuilds avatar May 02 '25 05:05 kurtbuilds