{"record":{"id":"cf9c8ccfa9d65988","repo":"DioxusLabs/dioxus","slug":"use-api-route-instead-of-route-to-use-openapi","errorCode":null,"errorMessage":"Use `api_route` instead of `route` to use OpenAPI options","messagePattern":"Use `api_route` instead of `route` to use OpenAPI options","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/fullstack-macro/src/lib.rs","lineNumber":637,"sourceCode":"                    path.push_str(&lit.value());\n                    path.push('}');\n                }\n                PathParam::Static(lit) => path.push_str(&lit.value()),\n            }\n        }\n\n        Some(path)\n    }\n\n    /// Removes the arguments in `route` from `args`, and merges them in the output.\n    pub fn from_route(\n        mut route: Route,\n        function: &ItemFn,\n        with_aide: bool,\n        method_from_macro: Option<Method>,\n    ) -> syn::Result<Self> {\n        if !with_aide && route.oapi_options.is_some() {\n            return Err(syn::Error::new(\n                Span::call_site(),\n                \"Use `api_route` instead of `route` to use OpenAPI options\",\n            ));\n        } else if with_aide && route.oapi_options.is_none() {\n            route.oapi_options = Some(OapiOptions {\n                summary: None,\n                description: None,\n                id: None,\n                hidden: None,\n                tags: None,\n                security: None,\n                responses: None,\n                transform: None,\n            });\n        }\n\n        let sig = &function.sig;\n        let mut arg_map = sig","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/fullstack-macro/src/lib.rs#L619-L655","documentation":"Check in ApiOptions::from_route: OpenAPI (aide) options were supplied on a route generated via #[route]/method macros instead of #[api_route]. The faulting input is the oapi_options present on the Route while with_aide is false; move the endpoint to api_route to attach OpenAPI options.","triggerScenarios":"Thrown at packages/fullstack-macro/src/lib.rs:637 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use `api_route` instead of `route` when you want to attach OpenAPI options to the endpoint."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}