add openapi parsing
This commit is contained in:
parent
cf70a331d7
commit
b9ba6e60d1
6 changed files with 24721 additions and 22 deletions
17
generator/src/main.rs
Normal file
17
generator/src/main.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use std::ffi::OsString;
|
||||
|
||||
mod openapi;
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
let spec = get_spec()?;
|
||||
dbg!(spec);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_spec() -> eyre::Result<openapi::OpenApiV2> {
|
||||
let path = std::env::var_os("FORGEJO_API_SPEC_PATH")
|
||||
.unwrap_or_else(|| OsString::from("./api_spec.json"));
|
||||
let file = std::fs::read(path)?;
|
||||
let spec = serde_json::from_slice::<openapi::OpenApiV2>(&file)?;
|
||||
Ok(spec)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue