Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.22 KB

SWAGGER_MODELS.md

File metadata and controls

85 lines (67 loc) · 2.22 KB

Swagger API Models

This document explains the various API models, retrieved from Swagger's API docs.
To view the Swagger docs yourself, see the Readme.

Recipe API

The largest API with the most amount of data provided.

Recipe

A recipe is comprised up of some top level metadata about the recipe, and a list of ingredients.

This data structure is created from the Recipe API provided by the MealDB. Items are renamed, reorganized, and regrouped to make a fluid and well structured recipe object that allows for easy iteration within the Angular front end application.

Recipe {
    category: string
    id: integer
    ingredient: [Ingredient{...}]
    instructions: [string]
    locale: string
    name: string
    source: string
    tags: [string]
    thumbnail: string
    video: string
}
Ingredient

A supporting object of a recipe that contains the ingredient information.

Ingredient {
    amount: string
    name: string
}

Cookbook API

A simple API responsible for linking and tracking user ids with recipe ids.

Cookbook

A Cookbook is nothing more than a record of the user id (cookbook owner) and a list of recipe ids that they have added to their cookbook. As this application grows, we can track more metadata about a recipe with a user by simply providing a complex object in the recipes object to contain things like user rating, notes, etc.

Cookbook {
    recipes: [string]
    userId: string
}

Auth API

An API responsible for logging a user in and maintaining their session.

Login

This object comes from the Okta authentication module, and contains enough information for us to verify a user is logged in, and to track them in the system. The idToken and accessToken are both Okta provided JWTs.

Login {
    authenticated: boolean
    idToken: string
    accessToken: string
}
User

The User object is our view of the current user. We create it by deserializing the Okta token in order to create or log in a user to the system.

User {
    email: string
    lastLogin: string($date-time)
    name: string
    userId: string
    username: string
}