Skip to content

Commit

Permalink
Add skill_ids to openapi docs; improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiphoseer committed Dec 8, 2021
1 parent 86a0293 commit b4a276d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
51 changes: 45 additions & 6 deletions res/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ components:
TableDef:
type: object
properties:
name:
type: string
name: { type: string }
columns:
type: array
items:
type: object
properties:
name:
type: string
data_type:
type: string
name: { type: string }
data_type: { type: string }
LocaleNode:
type: object
properties:
Expand All @@ -73,6 +70,33 @@ components:
id: { type: number }
MissionDrop: { type: boolean }
sortPriority: { type: number }
MissionTasks:
type: object
additionalProprties:
type: object
properties:
id: { type: integer }
locStatus: { type: integer }
taskType: { type: integer }
target: { type: integer }
targetGroup: { type: string }
targetValue: { type: integer }
taskParam1: { type: string }
largeTaskIcon: { type: string }
IconID: { type: integer }
uid: { type: integer }
largeTaskIconID: { type: integer }
localize: { type: boolean }
gate_version: { type: string }
SkillRev:
type: object
properties:
mission_tasks: { $ref: "#/components/schemas/NumArray" }
objects: { $ref: "#/components/schemas/NumArray" }
item_sets: { $ref: "#/components/schemas/NumArray" }
_embedded:
type: object
MissionTasks: { $ref: "#/components/schemas/MissionTasks" }
ErrorModel:
type: number
paths:
Expand Down Expand Up @@ -185,6 +209,21 @@ paths:
required: true
name: id
schema: { type: number }
"/v0/rev/skill_ids/{id}":
get:
tags: [rev]
description: Get data associated with an `SkillID`
responses:
"200":
description: The request was successfull
content:
application/json:
schema: { $ref: "#/components/schemas/SkillRev" }
parameters:
- in: path
required: true
name: id
schema: { type: number }
"/v0/rev/behaviors/{id}":
get:
tags: [rev]
Expand Down
4 changes: 3 additions & 1 deletion src/template/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use color_eyre::eyre::Context;
use notify::event::{AccessKind, AccessMode, EventKind, RemoveKind};
use pin_project::pin_project;
use std::{
Expand Down Expand Up @@ -111,7 +112,8 @@ pub fn load_meta_template(
path: &Path,
) -> Result<(), color_eyre::Report> {
info!("(re-)loading template.html");
let index_text = std::fs::read_to_string(&path)?;
let index_text = std::fs::read_to_string(&path)
.with_context(|| format!("Failed to load '{}'", path.display()))?;
let tpl_str = make_meta_template(&index_text);
let mut hb = reg
.write()
Expand Down

0 comments on commit b4a276d

Please sign in to comment.