Skip to content

Quickstart update / no Schema in the root #2

@RGGH

Description

@RGGH

quick start

Needs adjusting,

currently says

cargo rustapi new my-api

but this is what actually worked
cargo-rustapi new my-api


Also get compile errors when choosing these options on the menu - if fixed in outstanding PR then ignore this!

✔ Select a template · api - REST API with CRUD
✔ Select features (space to toggle) · jwt, view

❯ cargo rustapi new my-api

cd my-api

error: unrecognized subcommand 'rustapi'

Usage: cargo rustapi <COMMAND>

For more information, try '--help'.
cd: no such file or directory: my-api
❯ cargo-rustapi new my-api
cd my-api
✔ Select a template · api - REST API with CRUD
✔ Select features (space to toggle) · jwt, view

Project configuration:
  Name:     my-api
  Template: Api
  Features: jwt, view

✔ Create project? · yes

✨ Project created successfully!

Next steps:
  cd my-api
  cargo run

Then open http://localhost:8080 in your browser.
❯ cargo run
    Updating crates.io index
     Locking 298 packages to latest compatible versions
      Adding generic-array v0.14.7 (available: v0.14.9)
   Compiling proc-macro2 v1.0.106
   Compiling unicode-ident v1.0.22
   Compiling quote v1.0.44
   Compiling memchr v2.7.6
   Compiling libc v0.2.180
   Compiling serde_core v1.0.228
   Compiling regex-syntax v0.8.8
   Compiling cfg-if v1.0.4
   Compiling itoa v1.0.17
   Compiling serde v1.0.228
   Compiling stable_deref_trait v1.2.1
   Compiling equivalent v1.0.2
   Compiling smallvec v1.15.1
   Compiling hashbrown v0.16.1
   Compiling crossbeam-utils v0.8.21
   Compiling once_cell v1.21.3
   Compiling aho-corasick v1.1.4
   Compiling siphasher v1.0.2
   Compiling log v0.4.29
   Compiling autocfg v1.5.0
   Compiling syn v2.0.114
   Compiling bstr v1.12.1
   Compiling jobserver v0.1.34
   Compiling crossbeam-epoch v0.9.18
   Compiling find-msvc-tools v0.1.8
   Compiling shlex v1.3.0
   Compiling same-file v1.0.6
   Compiling crossbeam-deque v0.8.6
   Compiling cc v1.2.54
   Compiling zmij v1.0.17
   Compiling regex-automata v0.4.13
   Compiling walkdir v2.5.0
   Compiling bytes v1.11.0
   Compiling pin-project-lite v0.2.16
   Compiling num-traits v0.2.19
   Compiling serde_json v1.0.149
   Compiling indexmap v2.13.0
   Compiling parking_lot_core v0.9.12
   Compiling version_check v0.9.5
   Compiling scopeguard v1.2.0
   Compiling futures-core v0.3.31
   Compiling lock_api v0.4.14
   Compiling errno v0.3.14
   Compiling pkg-config v0.3.32
   Compiling winnow v0.7.14
   Compiling bitflags v1.3.2
   Compiling toml_write v0.1.2
   Compiling rustversion v1.0.22
   Compiling regex v1.12.2
   Compiling zstd-sys v2.0.16+zstd.1.5.7
   Compiling globset v0.4.18
   Compiling parking_lot v0.12.5
   Compiling signal-hook-registry v1.4.8
   Compiling proc-macro-error-attr v1.0.4
   Compiling http v1.4.0
   Compiling socket2 v0.6.2
   Compiling getrandom v0.2.17
   Compiling synstructure v0.13.2
   Compiling mio v1.1.1
   Compiling tracing-core v0.1.36
   Compiling zerocopy v0.8.36
   Compiling litemap v0.8.1
   Compiling writeable v0.6.2
   Compiling lazy_static v1.5.0
   Compiling syn v1.0.109
   Compiling ryu v1.0.22
   Compiling fnv v1.0.7
   Compiling ignore v0.4.25
   Compiling proc-macro-error v1.0.4
   Compiling icu_properties_data v2.1.2
   Compiling icu_normalizer_data v2.1.1
   Compiling percent-encoding v2.3.2
   Compiling unsafe-libyaml v0.2.11
   Compiling arc-swap v1.8.0
   Compiling globwalk v0.8.1
   Compiling serde_derive v1.0.228
   Compiling zerofrom-derive v0.1.6
   Compiling yoke-derive v0.8.1
   Compiling zerovec-derive v0.11.2
   Compiling displaydoc v0.2.5
   Compiling zerofrom v0.1.6
   Compiling tokio-macros v2.6.0
   Compiling yoke v0.8.1
   Compiling zerovec v0.11.5
   Compiling tracing-attributes v0.1.31
   Compiling zerotrie v0.2.3
   Compiling tokio v1.49.0
   Compiling phf_shared v0.11.3
   Compiling slab v0.4.11
   Compiling tinystr v0.8.2
   Compiling potential_utf v0.1.4
   Compiling either v1.15.0
   Compiling icu_collections v2.1.1
   Compiling icu_locale_core v2.1.1
   Compiling rand_core v0.6.4
   Compiling alloc-no-stdlib v2.0.4
   Compiling zstd-safe v7.2.4
   Compiling crc32fast v1.5.0
   Compiling futures-sink v0.3.31
   Compiling tracing v0.1.44
   Compiling alloc-stdlib v0.2.2
   Compiling rand v0.8.5
   Compiling itertools v0.11.0
   Compiling icu_provider v2.1.1
   Compiling http-body v1.0.1
   Compiling adler2 v2.0.1
   Compiling base62 v2.2.3
   Compiling ident_case v1.0.1
   Compiling serde_spanned v0.6.9
   Compiling toml_datetime v0.6.11
   Compiling triomphe v0.1.15
   Compiling normpath v1.5.0
   Compiling toml_edit v0.22.27
   Compiling pin-utils v0.1.0
   Compiling strsim v0.11.1
   Compiling simd-adler32 v0.3.8
   Compiling darling_core v0.20.11
   Compiling miniz_oxide v0.8.9
   Compiling serde_yaml v0.9.34+deprecated
   Compiling icu_normalizer v2.1.1
   Compiling icu_properties v2.1.2
   Compiling ppv-lite86 v0.2.21
   Compiling tokio-util v0.7.18
   Compiling rand_chacha v0.3.1
   Compiling toml v0.8.23
   Compiling phf_generator v0.11.3
   Compiling brotli-decompressor v5.0.0
   Compiling futures-macro v0.3.31
   Compiling indexmap v1.9.3
   Compiling httparse v1.10.1
   Compiling unicase v2.9.0
   Compiling futures-task v0.3.31
   Compiling tinyvec_macros v0.1.1
   Compiling getrandom v0.3.4
   Compiling tinyvec v1.10.0
   Compiling futures-util v0.3.31
   Compiling brotli v8.0.2
   Compiling mime_guess v2.0.5
   Compiling rust-i18n-support v3.1.5
   Compiling flate2 v1.1.8
   Compiling phf_codegen v0.11.3
   Compiling darling_macro v0.20.11
   Compiling idna_adapter v1.2.1
   Compiling phf v0.11.3
   Compiling rust-i18n v3.1.5
   Compiling pin-project-internal v1.1.10
   Compiling form_urlencoded v1.2.2
   Compiling parse-zoneinfo v0.3.1
   Compiling uuid v1.20.0
   Compiling linkme-impl v0.3.35
   Compiling httpdate v1.0.3
   Compiling utf8_iter v1.0.4
   Compiling iana-time-zone v0.1.65
   Compiling ucd-trie v0.1.7
   Compiling bitflags v2.10.0
   Compiling atomic-waker v1.1.2
   Compiling tower-service v0.3.3
   Compiling byteorder v1.5.0
   Compiling tower-layer v0.3.3
   Compiling base64 v0.22.1
   Compiling try-lock v0.2.5
   Compiling hashbrown v0.12.3
   Compiling compression-core v0.4.31
   Compiling glob v0.3.3
   Compiling thiserror v1.0.69
   Compiling hdrhistogram v7.5.4
   Compiling pin-project v1.1.10
   Compiling want v0.3.1
   Compiling h2 v0.4.13
   Compiling pest v2.8.5
   Compiling utoipa-gen v4.3.1
   Compiling rust-i18n-macro v3.1.5
   Compiling chrono v0.4.43
   Compiling chrono-tz-build v0.3.0
   Compiling idna v1.1.0
   Compiling zstd v0.13.3
   Compiling darling v0.20.11
   Compiling compression-codecs v0.4.36
   Compiling unicode-normalization v0.1.25
   Compiling http-body-util v0.1.3
   Compiling thiserror-impl v1.0.69
   Compiling futures-channel v0.3.31
   Compiling linkme v0.3.35
   Compiling libm v0.2.16
   Compiling powerfmt v0.2.0
   Compiling num-conv v0.2.0
   Compiling time-core v0.1.8
   Compiling thiserror v2.0.18
   Compiling unicode-bidi v0.3.18
   Compiling mime v0.3.17
   Compiling time-macros v0.2.26
   Compiling deranged v0.5.5
   Compiling idna v0.5.0
   Compiling pest_meta v2.8.5
   Compiling async-compression v0.4.37
   Compiling validator_derive v0.18.2
   Compiling chrono-tz v0.9.0
   Compiling url v2.5.8
   Compiling tower v0.4.13
   Compiling rustapi-macros v0.1.207
   Compiling hyper v1.8.1
   Compiling thiserror-impl v2.0.18
   Compiling async-trait v0.1.89
   Compiling utoipa v4.2.3
   Compiling sharded-slab v0.1.7
   Compiling tracing-log v0.2.0
   Compiling matchers v0.2.0
   Compiling num-integer v0.1.46
   Compiling ring v0.17.14
   Compiling thread_local v1.1.9
   Compiling http-range-header v0.4.2
   Compiling ipnet v2.11.0
   Compiling nu-ansi-term v0.50.3
   Compiling iri-string v0.7.10
   Compiling base64 v0.21.7
   Compiling hyper-util v0.1.19
   Compiling tracing-subscriber v0.3.22
   Compiling rustapi-validate v0.1.207
   Compiling num-bigint v0.4.6
   Compiling validator v0.18.1
   Compiling rustapi-openapi v0.1.207
   Compiling tower-http v0.5.2
   Compiling time v0.3.46
   Compiling pest_generator v2.8.5
   Compiling serde_urlencoded v0.7.1
   Compiling socket2 v0.5.10
   Compiling inventory v0.3.21
   Compiling deunicode v1.6.2
   Compiling matchit v0.7.3
   Compiling untrusted v0.9.0
   Compiling slug v0.1.6
   Compiling pest_derive v2.8.5
   Compiling simple_asn1 v0.6.3
   Compiling pem v3.0.6
   Compiling humansize v2.1.3
   Compiling rustapi-core v0.1.207
   Compiling globwalk v0.9.1
   Compiling unicode-segmentation v1.12.0
   Compiling jsonwebtoken v9.3.1
   Compiling rustapi-extras v0.1.207
   Compiling tera v1.20.1
   Compiling rustapi-view v0.1.207
   Compiling rustapi-rs v0.1.207
   Compiling my-api v0.1.0 (/home/oem/rust/my-api)
error[E0432]: unresolved import `rustapi_rs::Schema`
 --> src/models/mod.rs:4:5
  |
4 | use rustapi_rs::Schema;
  |     ^^^^^^^^^^^^^^^^^^ no `Schema` in the root
  |
help: a similar name exists in the module (notice the capitalization)
  |
4 - use rustapi_rs::Schema;
4 + use rustapi_rs::schema;
  |
help: consider importing one of these traits instead
  |
4 - use rustapi_rs::Schema;
4 + use crate::Schema;
  |
4 | use rustapi_rs::prelude::Schema;
  |                 +++++++++

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
 --> src/handlers/items.rs:8:3
  |
8 | #[rustapi::get("/items")]
  |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
 --> src/handlers/items.rs:9:3
  |
9 | #[rustapi::tag("Items")]
  |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:10:3
   |
10 | #[rustapi::summary("List all items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:17:3
   |
17 | #[rustapi::get("/items/{id}")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:18:3
   |
18 | #[rustapi::tag("Items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:19:3
   |
19 | #[rustapi::summary("Get item by ID")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:33:3
   |
33 | #[rustapi::post("/items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:34:3
   |
34 | #[rustapi::tag("Items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:35:3
   |
35 | #[rustapi::summary("Create a new item")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:49:3
   |
49 | #[rustapi::put("/items/{id}")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:50:3
   |
50 | #[rustapi::tag("Items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:51:3
   |
51 | #[rustapi::summary("Update an item")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:75:3
   |
75 | #[rustapi::delete("/items/{id}")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:76:3
   |
76 | #[rustapi::tag("Items")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/handlers/items.rs:77:3
   |
77 | #[rustapi::summary("Delete an item")]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustapi`
  --> src/main.rs:11:3
   |
11 | #[rustapi::main]
   |   ^^^^^^^ use of unresolved module or unlinked crate `rustapi`

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `utoipa`
 --> src/handlers/mod.rs:9:21
  |
9 | #[derive(Serialize, Schema)]
  |                     ^^^^^^ use of unresolved module or unlinked crate `utoipa`
  |
  = help: if you wanted to use a crate named `utoipa`, use `cargo add utoipa` to add it to your `Cargo.toml`
  = note: this error originates in the derive macro `Schema` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `my-api` (bin "my-api") due to 18 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions