chore: moved schema file to torn-api crate

This commit is contained in:
pyrite 2025-05-27 19:27:58 +02:00
parent 11c5d71bf6
commit 6d57f275a2
Signed by: pyrite
GPG key ID: 7F1BA9170CD35D15
10 changed files with 33 additions and 34 deletions

View file

@ -61,11 +61,11 @@ impl Model {
#[cfg(test)]
mod test {
use super::*;
use crate::openapi::schema::OpenApiSchema;
use crate::openapi::schema::test::get_schema;
#[test]
fn resolve_newtypes() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let user_id_schema = schema.components.schemas.get("UserId").unwrap();
@ -100,7 +100,7 @@ mod test {
#[test]
fn resolve_all() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut unresolved = vec![];
let total = schema.components.schemas.len();

View file

@ -420,11 +420,11 @@ impl ObjectNamespace<'_> {
mod test {
use super::*;
use crate::openapi::schema::OpenApiSchema;
use crate::openapi::schema::test::get_schema;
#[test]
fn resolve_object() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let attack = schema.components.schemas.get("FactionUpgrades").unwrap();
@ -436,7 +436,7 @@ mod test {
#[test]
fn resolve_objects() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut objects = 0;
let mut unresolved = vec![];

View file

@ -342,13 +342,13 @@ The default value [Self::{}](self::{}#variant.{})"#,
#[cfg(test)]
mod test {
use crate::openapi::{path::OpenApiPathParameter, schema::OpenApiSchema};
use crate::openapi::{path::OpenApiPathParameter, schema::test::get_schema};
use super::*;
#[test]
fn resolve_components() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut parameters = 0;
let mut unresolved = vec![];
@ -376,7 +376,7 @@ mod test {
#[test]
fn resolve_inline() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut params = 0;
let mut unresolved = Vec::new();
@ -404,7 +404,7 @@ mod test {
#[test]
fn codegen_inline() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut params = 0;
let mut unresolved = Vec::new();

View file

@ -592,11 +592,11 @@ impl PathNamespace<'_> {
mod test {
use super::*;
use crate::openapi::schema::OpenApiSchema;
use crate::openapi::schema::test::get_schema;
#[test]
fn resolve_paths() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut paths = 0;
let mut unresolved = vec![];
@ -624,7 +624,7 @@ mod test {
#[test]
fn codegen_paths() {
let schema = OpenApiSchema::read().unwrap();
let schema = get_schema();
let mut paths = 0;
let mut unresolved = vec![];