Skip to main content

generate_capability_manifest_from_openapi

Function generate_capability_manifest_from_openapi 

Source
pub fn generate_capability_manifest_from_openapi(
    api_name: &str,
    spec: &OpenAPI,
    cached_spec: &CachedSpec,
    global_config: Option<&GlobalConfig>,
) -> Result<String, Error>
Expand description

Generates a capability manifest from an OpenAPI specification.

This function creates a comprehensive JSON description of all available commands, parameters, and security requirements directly from the original OpenAPI spec, preserving all metadata that might be lost in the cached representation.

§Arguments

  • api_name - The name of the API context
  • spec - The original OpenAPI specification
  • global_config - Optional global configuration for URL resolution

§Returns

  • Ok(String) - JSON-formatted capability manifest
  • Err(Error) - If JSON serialization fails

§Errors

Returns an error if JSON serialization fails