remove description from ApiMethod
We use the description from parameters ObjectSchema instead.
This commit is contained in:
parent
768e01091a
commit
3e1497fb75
|
@ -5,7 +5,6 @@ use serde_json::{Value};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub struct ApiMethod {
|
pub struct ApiMethod {
|
||||||
pub description: &'static str,
|
|
||||||
pub parameters: ObjectSchema,
|
pub parameters: ObjectSchema,
|
||||||
pub returns: Schema,
|
pub returns: Schema,
|
||||||
pub handler: fn(Value, &ApiMethod) -> Result<Value, Error>,
|
pub handler: fn(Value, &ApiMethod) -> Result<Value, Error>,
|
||||||
|
|
|
@ -30,7 +30,6 @@ pub fn router() -> Router {
|
||||||
|
|
||||||
let route3 = Router::new()
|
let route3 = Router::new()
|
||||||
.get(ApiMethod {
|
.get(ApiMethod {
|
||||||
description: "Another Endpoint.",
|
|
||||||
parameters: ObjectSchema::new("Another Endpoint."),
|
parameters: ObjectSchema::new("Another Endpoint."),
|
||||||
returns: Schema::Null,
|
returns: Schema::Null,
|
||||||
handler: |param, _info| {
|
handler: |param, _info| {
|
||||||
|
@ -43,8 +42,7 @@ pub fn router() -> Router {
|
||||||
let route2 = Router::new()
|
let route2 = Router::new()
|
||||||
.get(ApiMethod {
|
.get(ApiMethod {
|
||||||
handler: test_sync_api_handler,
|
handler: test_sync_api_handler,
|
||||||
description: "This is a simple test.",
|
parameters: ObjectSchema::new("This is a simple test.")
|
||||||
parameters: ObjectSchema::new("This is a simple test.")
|
|
||||||
.optional("force", BooleanSchema::new("Test for boolean options")),
|
.optional("force", BooleanSchema::new("Test for boolean options")),
|
||||||
returns: Schema::Null,
|
returns: Schema::Null,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue