Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Spike: Rust api #2

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

Spike: Rust api #2

wants to merge 30 commits into from

Conversation

0atman
Copy link

@0atman 0atman commented Feb 7, 2022

  • user "auth"
  • OpenAPI UI
  • GH actions for build + lint

API design

  • post "/publish"
  • def form_exists_for_user?(user, key)
  • get "/published"
  • get "/published/:id"
  • def authenticated_user
  • def forms_for_user(user)
  • def seed_data_for_user(user)
  • get "/seed/:user" (optional, designer expects forms to exist)

@0atman 0atman self-assigned this Feb 7, 2022
@0atman 0atman changed the title Initial rust project Spike: Rust api Feb 8, 2022
@0atman
Copy link
Author

0atman commented Feb 14, 2022

openapi UI working (actually it was working last week)

Screenshot from 2022-02-14 17-53-10

@0atman
Copy link
Author

0atman commented Feb 15, 2022

Screenshot from 2022-02-15 16-57-46

id,
"INSERT INTO forms
VALUES ($1, $2, $3, $4, $5)
RETURNING *;",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have to add RETURNING if you want postgres to give you the table back, otherwise you just get "1 row(s) updated" etc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took me longer than I care to admit to realise this...

0atman and others added 5 commits February 22, 2022 16:54
get /published for user working

Co-authored-by: alice-carr <alice-carr@users.noreply.github.com>
Co-authored-by: James Sheppard <james-sheppard-gov-uk@users.noreply.github.com>
let api_service = OpenApiService::new(
api::Api,
"Forms API Rust Prototype",
env!("CARGO_PKG_VERSION"))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@james-sheppard-gov-uk being a genius suggsted we get the semver from the cargo.toml 👌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants