You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---- test_basic_structure stdout ----
thread 'test_basic_structure' panicked at 'Couldn't deser doc: Yaml(Message("data did not match any variant of untagged enum OpenApi", None))', src/lib.rs:34:15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Here is the code I used to generate the error:
#[test]
fn test_basic_structure() {
use std::io::{self, Cursor};
let doc = r#"swagger: "2.0"
info:
title: Sample API
description: API description in Markdown.
version: 1.0.0
host: api.example.com
basePath: /v1
schemes:
- https
paths:
/users:
get:
summary: Some text
description: Some more text
produces:
- application/json
responses:
200:
description: OK"#.to_string();
let bytes = doc.as_bytes().to_vec();
let mut bytes = Cursor::new(bytes);
let api = openapi::from_reader(&mut bytes).expect("Couldn't deser doc");
}
The text was updated successfully, but these errors were encountered:
this crate is unable to deserialize the document shown here, in the OpenAPI v2 spec: https://swagger.io/docs/specification/2-0/basic-structure/ . It fails with the following error:
Here is the code I used to generate the error:
The text was updated successfully, but these errors were encountered: