mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(ci): Create a new workflow to validate the generated openAPI spec file (openapi_spec.json) (#1323)
Co-authored-by: kritikmodi <kritik.modi@juspay.in> Co-authored-by: pixincreate@work <69745008+pixincreate@users.noreply.github.com> Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
@ -13,13 +13,13 @@ async fn main() -> ApplicationResult<()> {
|
||||
{
|
||||
use router::configs::settings::Subcommand;
|
||||
if let Some(Subcommand::GenerateOpenapiSpec) = cmd_line.subcommand {
|
||||
let file_path = "openapi/generated.json";
|
||||
let file_path = "openapi/openapi_spec.json";
|
||||
#[allow(clippy::expect_used)]
|
||||
std::fs::write(
|
||||
file_path,
|
||||
<router::openapi::ApiDoc as utoipa::OpenApi>::openapi()
|
||||
.to_pretty_json()
|
||||
.expect("Failed to generate serialize OpenAPI specification as JSON"),
|
||||
.expect("Failed to serialize OpenAPI specification as JSON"),
|
||||
)
|
||||
.expect("Failed to write OpenAPI specification to file");
|
||||
println!("Successfully saved OpenAPI specification file at '{file_path}'");
|
||||
|
||||
Reference in New Issue
Block a user