openapi / actix-swagger

Swagger code generator for actix-web framework
https://crates.io/crates/cargo-swagg
MIT License
113 stars 8 forks source link

Support `array` type #25

Open jarcand opened 3 years ago

jarcand commented 3 years ago

Unless I'm missing something, the spec supports array type but the parse_schema function just fails with unimplemented:

I didn't see any other bug tracking this, so thought I'd start one.

Thanks!

sergeysova commented 3 years ago

Hello, thank you for contribution.

can you attach an example swagger file with spec that fails? I going to implement array support

jarcand commented 3 years ago

Here's a minimal sample I made:

openapi-with-array.yaml.txt

Here's the output when compiling:

$ RUST_BACKTRACE=1 cargo-swagg openapi-with-array.yaml
thread 'main' panicked at 'not implemented', /home/jarcand/.cargo/registry/src/github.com-1ecc6299db9ec823/swagg-0.3.0/src/highway/mod.rs:269:40
stack backtrace:
   0: rust_begin_unwind
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/core/src/panicking.rs:50:5
   3: swagg::highway::parse_ref_or_schema
   4: swagg::highway::parse_ref_or_schema
   5: swagg::to_string
   6: cargo_swagg::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
sergeysova commented 3 years ago

Thank you. I'm going to review and fix it

jayvdb commented 2 years ago

This is a significant blocker for adoption of actix-swagger.