openapi: 3.2.0
info:
title: Tandoor Enterprise Social Recipe API
version: 0.0.0 (2.6.13)
x-logo:
url: /static/assets/brand_logo.svg
backgroundColor: '#FFFFFF'
altText: Tandoor logo
href: /
description: Tandoor API Docs
tags:
- name: Enterprise Social Recipe
paths:
/api/enterprise-social-recipe/:
get:
operationId: apiEnterpriseSocialRecipeList
description: logs request counts to redis cache total/per user/
parameters:
- in: query
name: books
schema:
type: array
items:
type: integer
description: ID of book a recipe should be in. For multiple repeat parameter.
- in: query
name: books_and
schema:
type: array
items:
type: integer
description: Book IDs, repeat for multiple. Return recipes with all of the books.
- in: query
name: books_and_not
schema:
type: array
items:
type: integer
description: Book IDs, repeat for multiple. Exclude recipes with all of the books.
- in: query
name: books_or
schema:
type: array
items:
type: integer
description: Book IDs, repeat for multiple. Return recipes with any of the books
- in: query
name: books_or_not
schema:
type: array
items:
type: integer
description: Book IDs, repeat for multiple. Exclude recipes with any of the books.
- in: query
name: cookedon_gte
schema:
type: string
format: date
description: Filter recipes last cooked on the given date or after.
- in: query
name: cookedon_lte
schema:
type: string
format: date
description: Filter recipes last cooked on the given date or before.
- in: query
name: createdby
schema:
type: integer
description: Filter recipes for ones created by the given user ID
- in: query
name: createdon
schema:
type: string
format: date
description: Filter recipes created on the given date.
- in: query
name: createdon_gte
schema:
type: string
format: date
description: Filter recipes created on the given date or after.
- in: query
name: createdon_lte
schema:
type: string
format: date
description: Filter recipes created on the given date or before.
- in: query
name: filter
schema:
type: integer
description: ID of a custom filter. Returns all recipes matched by that filter.
- in: query
name: foods
schema:
type: array
items:
type: integer
description: ID of food a recipe should have. For multiple repeat parameter.
- in: query
name: foods_and
schema:
type: array
items:
type: integer
description: Food IDs, repeat for multiple. Return recipes with all of the foods.
- in: query
name: foods_and_not
schema:
type: array
items:
type: integer
description: Food IDs, repeat for multiple. Exclude recipes with all of the foods.
- in: query
name: foods_or
schema:
type: array
items:
type: integer
description: Food IDs, repeat for multiple. Return recipes with any of the foods
- in: query
name: foods_or_not
schema:
type: array
items:
type: integer
description: Food IDs, repeat for multiple. Exclude recipes with any of the foods.
- in: query
name: include_children
schema:
type: boolean
description: Include child keywords and foods in search results. [true/false]
- in: query
name: internal
schema:
type: boolean
description: If only internal recipes should be returned. [true/false]
- in: query
name: keyword
schema:
type: integer
description: Keyword ID to only return recipes with the given keyword
- in: query
name: keywords
schema:
type: array
items:
type: integer
description: ID of keyword a recipe should have. For multiple repeat parameter. Equivalent to keywords_or
- in: query
name: keywords_and
schema:
type: array
items:
type: integer
description: Keyword IDs, repeat for multiple. Return recipes with all of the keywords.
- in: query
name: keywords_and_not
schema:
type: array
items:
type: integer
description: Keyword IDs, repeat for multiple. Exclude recipes with all of the keywords.
- in: query
name: keywords_or
schema:
type: array
items:
type: integer
description: Keyword IDs, repeat for multiple. Return recipes with any of the keywords
- in: query
name: keywords_or_not
schema:
type: array
items:
type: integer
description: Keyword IDs, repeat for multiple. Exclude recipes with any of the keywords.
- in: query
name: makenow
schema:
type: boolean
description: Filter recipes that can be made with OnHand food. [true/false]
- in: query
name: new
schema:
type: boolean
description: Returns new results first in search results. [true/false]
- in: query
name: num_recent
schema:
type: integer
description: Returns the given number of recently viewed recipes before search results (if given)
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
- in: query
name: query
schema:
type: string
description: Query to filter recipe name against
- in: query
name: random
schema:
type: boolean
description: Returns the results in randomized order. [true/false]
- in: query
name: rating
schema:
type: integer
description: Exact rating of recipe
- in: query
name: rating_gte
schema:
type: integer
description: Rating a recipe should have or greater.
- in: query
name: rating_lte
schema:
type: integer
description: Rating a recipe should have or smaller.
- in: query
name: sort_order
schema:
type: string
description: 'Determines the order of the results. Options are: score,-score,name,-name,lastcooked,-lastcooked,rating,-rating,times_cooked,-times_cooked,created_at,-created_at,lastviewed,-lastviewed'
- in: query
name: timescooked
schema:
type: integer
description: Filter recipes cooked X times.
- in: query
name: timescooked_gte
schema:
type: integer
description: Filter recipes cooked X times or more.
- in: query
name: timescooked_lte
schema:
type: integer
description: Filter recipes cooked X times or less.
- in: query
name: token
schema:
type: string
description: Embed share token for public retrieval.
- in: query
name: units
schema:
type: integer
description: ID of unit a recipe should have.
- in: query
name: updatedon
schema:
type: string
format: date
description: Filter recipes updated on the given date.
- in: query
name: updatedon_gte
schema:
type: string
format: date
description: Filter recipes updated on the given date.
- in: query
name: updatedon_lte
schema:
type: string
format: date
description: Filter recipes updated on the given date.
- in: query
name: viewedon_gte
schema:
type: string
format: date
description: Filter recipes lasts viewed on the given date.
- in: query
name: viewedon_lte
schema:
type: string
format: date
description: Filter recipes lasts viewed on the given date.
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedEnterpriseSocialRecipeSearchList'
description: ''
summary: Api enterprise social recipe list
x-summary-source: derived
post:
operationId: apiEnterpriseSocialRecipeCreate
description: logs request counts to redis cache total/per user/
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Recipe'
multipart/form-data:
schema:
$ref: '#/components/schemas/Recipe'
required: true
security:
- ApiKeyAuth: []
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe create
x-summary-source: derived
/api/enterprise-social-recipe/{id}/:
get:
operationId: apiEnterpriseSocialRecipeRetrieve
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
- in: query
name: share
schema:
type: string
- in: query
name: token
schema:
type: string
description: Embed share token for public retrieval.
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe retrieve
x-summary-source: derived
put:
operationId: apiEnterpriseSocialRecipeUpdate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Recipe'
multipart/form-data:
schema:
$ref: '#/components/schemas/Recipe'
required: true
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe update
x-summary-source: derived
patch:
operationId: apiEnterpriseSocialRecipePartialUpdate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedRecipe'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedRecipe'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedRecipe'
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe partial update
x-summary-source: derived
delete:
operationId: apiEnterpriseSocialRecipeDestroy
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'204':
description: No response body
summary: Api enterprise social recipe destroy
x-summary-source: derived
/api/enterprise-social-recipe/{id}/aiproperties/:
post:
operationId: apiEnterpriseSocialRecipeAipropertiesCreate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
- in: query
name: provider
schema:
type: integer
description: ID of the AI provider that should be used for this AI request
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Recipe'
multipart/form-data:
schema:
$ref: '#/components/schemas/Recipe'
required: true
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe aiproperties create
x-summary-source: derived
/api/enterprise-social-recipe/{id}/cascading/:
get:
operationId: apiEnterpriseSocialRecipeCascadingList
description: get a paginated list of objects that will be cascaded (deleted) when deleting the selected object
parameters:
- in: query
name: cache
schema:
type: boolean
default: true
description: If results can be cached or not
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedGenericModelReferenceList'
description: ''
summary: Api enterprise social recipe cascading list
x-summary-source: derived
/api/enterprise-social-recipe/{id}/delete_external/:
patch:
operationId: apiEnterpriseSocialRecipeDeleteExternalPartialUpdate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PatchedRecipe'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PatchedRecipe'
multipart/form-data:
schema:
$ref: '#/components/schemas/PatchedRecipe'
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Recipe'
description: ''
summary: Api enterprise social recipe delete external partial update
x-summary-source: derived
/api/enterprise-social-recipe/{id}/image/:
put:
operationId: apiEnterpriseSocialRecipeImageUpdate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/RecipeImage'
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RecipeImage'
description: ''
summary: Api enterprise social recipe image update
x-summary-source: derived
/api/enterprise-social-recipe/{id}/nulling/:
get:
operationId: apiEnterpriseSocialRecipeNullingList
description: get a paginated list of objects where the selected object will be removed whe its deleted
parameters:
- in: query
name: cache
schema:
type: boolean
default: true
description: If results can be cached or not
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedGenericModelReferenceList'
description: ''
summary: Api enterprise social recipe nulling list
x-summary-source: derived
/api/enterprise-social-recipe/{id}/protecting/:
get:
operationId: apiEnterpriseSocialRecipeProtectingList
description: get a paginated list of objects that are protecting the selected object form being deleted
parameters:
- in: query
name: cache
schema:
type: boolean
default: true
description: If results can be cached or not
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
- name: page
required: false
in: query
description: A page number within the paginated result set.
schema:
type: integer
- name: page_size
required: false
in: query
description: Number of results to return per page.
schema:
type: integer
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedGenericModelReferenceList'
description: ''
summary: Api enterprise social recipe protecting list
x-summary-source: derived
/api/enterprise-social-recipe/{id}/related/:
get:
operationId: apiEnterpriseSocialRecipeRelatedList
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RecipeSimple'
description: ''
summary: Api enterprise social recipe related list
x-summary-source: derived
/api/enterprise-social-recipe/{id}/shopping/:
put:
operationId: apiEnterpriseSocialRecipeShoppingUpdate
description: logs request counts to redis cache total/per user/
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this recipe.
required: true
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RecipeShoppingUpdate'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RecipeShoppingUpdate'
multipart/form-data:
schema:
$ref: '#/components/schemas/RecipeShoppingUpdate'
required: true
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RecipeShoppingUpdate'
description: ''
summary: Api enterprise social recipe shopping update
x-summary-source: derived
/api/enterprise-social-recipe/batch_update/:
put:
operationId: apiEnterpriseSocialRecipeBatchUpdateUpdate
description: logs request counts to redis cache total/per user/
tags:
- Enterprise Social Recipe
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RecipeBatchUpdate'
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/RecipeBatchUpdate'
multipart/form-data:
schema:
$ref: '#/components/schemas/RecipeBatchUpdate'
required: true
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/RecipeBatchUpdate'
description: ''
summary: Api enterprise social recipe batch update update
x-summary-source: derived
/api/enterprise-social-recipe/flat/:
get:
operationId: apiEnterpriseSocialRecipeFlatList
description: logs request counts to redis cache total/per user/
tags:
- Enterprise Social Recipe
security:
- ApiKeyAuth: []
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/RecipeFlat'
description: ''
summary: Api enterprise social recipe flat list
x-summary-source: derived
components:
schemas:
RecipeShoppingUpdate:
type: object
properties:
id:
type: integer
readOnly: false
list_recipe:
type:
- integer
- 'null'
writeOnly: true
description: Existing shopping list to update
ingredients:
type: array
items:
type:
- integer
- 'null'
writeOnly: true
description: List of ingredient IDs from the recipe to add, if not provided all ingredients will be added.
servings:
type:
- integer
- 'null'
writeOnly: true
default: 1
description: Providing a list_recipe ID and servings of 0 will delete that shopping list.
required:
- ingredients
Unit:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
minLength: 1
plural_name:
type:
- string
- 'null'
maxLength: 128
description:
type:
- string
- 'null'
base_unit:
type:
- string
- 'null'
maxLength: 256
open_data_slug:
type:
- string
- 'null'
maxLength: 128
required:
- name
Keyword:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 64
label:
type: string
readOnly: true
description:
type: string
parent:
type: integer
readOnly: true
numchild:
type: integer
readOnly: true
created_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
full_name:
type: string
description: 'Returns a string representation of a tree node and it''s ancestors,
e.g. ''Cuisine > Asian > Chinese > Catonese''.'
readOnly: true
required:
- created_at
- full_name
- label
- name
- numchild
- parent
- updated_at
UserFileView:
type: object
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
file_download:
type: string
readOnly: true
preview:
type: string
readOnly: true
file_size_kb:
type: integer
readOnly: true
created_by:
allOf:
- $ref: '#/components/schemas/User'
readOnly: true
created_at:
type: string
format: date-time
readOnly: true
required:
- created_at
- created_by
- file_download
- file_size_kb
- name
- preview
User:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
username:
type: string
readOnly: true
description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
first_name:
type: string
maxLength: 150
last_name:
type: string
maxLength: 150
display_name:
type: string
readOnly: true
is_staff:
type: boolean
readOnly: true
title: Staff status
description: Designates whether the user can log into this admin site.
is_superuser:
type: boolean
readOnly: true
title: Superuser status
description: Designates that this user has all permissions without explicitly assigning them.
is_active:
type: boolean
readOnly: true
title: Active
description: Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
required:
- display_name
- is_active
- is_staff
- is_superuser
- username
NutritionInformation:
type: object
properties:
id:
type: integer
readOnly: false
carbohydrates:
type: number
format: double
fats:
type: number
format: double
proteins:
type: number
format: double
calories:
type: number
format: double
source:
type:
- string
- 'null'
maxLength: 512
required:
- calories
- carbohydrates
- fats
- proteins
Step:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
instruction:
type: string
ingredients:
type: array
items:
$ref: '#/components/schemas/Ingredient'
instructions_markdown:
type: string
readOnly: true
time:
type: integer
maximum: 2147483647
minimum: -2147483648
order:
type: integer
maximum: 2147483647
minimum: -2147483648
show_as_header:
type: boolean
file:
allOf:
- $ref: '#/components/schemas/UserFileView'
step_recipe:
type:
- integer
- 'null'
step_recipe_data:
readOnly: true
numrecipe:
type: integer
readOnly: true
show_ingredients_table:
type: boolean
required:
- ingredients
- instructions_markdown
- numrecipe
- step_recipe_data
FoodSimple:
type: object
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
minLength: 1
plural_name:
type:
- string
- 'null'
maxLength: 128
required:
- name
FoodInheritField:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
name:
type:
- string
- 'null'
field:
type:
- string
- 'null'
required: []
Property:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
property_amount:
type:
- number
- 'null'
format: double
property_type:
$ref: '#/components/schemas/PropertyType'
required:
- property_amount
- property_type
PaginatedEnterpriseSocialRecipeSearchList:
type: object
required:
- count
- results
properties:
count:
type: integer
example: 123
next:
type:
- string
- 'null'
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type:
- string
- 'null'
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/EnterpriseSocialRecipeSearch'
timestamp:
type: string
format: date-time
Recipe:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
description:
type:
- string
- 'null'
maxLength: 512
image:
type:
- string
- 'null'
format: uri
readOnly: true
keywords:
type: array
items:
$ref: '#/components/schemas/Keyword'
steps:
type: array
items:
$ref: '#/components/schemas/Step'
working_time:
type: integer
maximum: 2147483647
minimum: -2147483648
waiting_time:
type: integer
maximum: 2147483647
minimum: -2147483648
created_by:
allOf:
- $ref: '#/components/schemas/User'
readOnly: true
created_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
source_url:
type:
- string
- 'null'
maxLength: 1024
internal:
type: boolean
show_ingredient_overview:
type: boolean
nutrition:
allOf:
- $ref: '#/components/schemas/NutritionInformation'
properties:
type: array
items:
$ref: '#/components/schemas/Property'
food_properties:
readOnly: true
servings:
type: integer
maximum: 2147483647
minimum: -2147483648
file_path:
type: string
maxLength: 512
servings_text:
type: string
maxLength: 32
diameter:
type: integer
maximum: 2147483647
minimum: -2147483648
diameter_text:
type: string
maxLength: 32
rating:
type:
- number
- 'null'
format: double
readOnly: true
last_cooked:
type:
- string
- 'null'
format: date-time
readOnly: true
private:
type: boolean
shared:
type: array
items:
$ref: '#/components/schemas/User'
required:
- created_at
- created_by
- food_properties
- image
- last_cooked
- name
- rating
- steps
- updated_at
Food:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
minLength: 1
plural_name:
type:
- string
- 'null'
maxLength: 128
description:
type: string
shopping:
type: string
readOnly: true
recipe:
allOf:
- $ref: '#/components/schemas/RecipeSimple'
url:
type:
- string
- 'null'
maxLength: 1024
properties:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/Property'
properties_food_amount:
type: number
format: double
properties_food_unit:
allOf:
- $ref: '#/components/schemas/Unit'
fdc_id:
type:
- integer
- 'null'
maximum: 2147483647
minimum: -2147483648
food_onhand:
type:
- boolean
- 'null'
supermarket_category:
allOf:
- $ref: '#/components/schemas/SupermarketCategory'
parent:
type: integer
readOnly: true
numchild:
type: integer
readOnly: true
inherit_fields:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/FoodInheritField'
full_name:
type: string
description: 'Returns a string representation of a tree node and it''s ancestors,
e.g. ''Cuisine > Asian > Chinese > Catonese''.'
readOnly: true
ignore_shopping:
type: boolean
substitute:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/FoodSimple'
substitute_siblings:
type: boolean
substitute_children:
type: boolean
substitute_onhand:
type: boolean
readOnly: true
child_inherit_fields:
type:
- array
- 'null'
items:
$ref: '#/components/schemas/FoodInheritField'
open_data_slug:
type:
- string
- 'null'
maxLength: 128
shopping_lists:
type: array
items:
$ref: '#/components/schemas/ShoppingList'
required:
- full_name
- name
- numchild
- parent
- shopping
- substitute_onhand
PropertyType:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
unit:
type:
- string
- 'null'
maxLength: 64
description:
type:
- string
- 'null'
maxLength: 512
order:
type: integer
default: 0
open_data_slug:
type:
- string
- 'null'
maxLength: 128
fdc_id:
type:
- integer
- 'null'
maximum: 2147483647
minimum: -2147483648
required:
- name
PatchedRecipe:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
description:
type:
- string
- 'null'
maxLength: 512
image:
type:
- string
- 'null'
format: uri
readOnly: true
keywords:
type: array
items:
$ref: '#/components/schemas/Keyword'
steps:
type: array
items:
$ref: '#/components/schemas/Step'
working_time:
type: integer
maximum: 2147483647
minimum: -2147483648
waiting_time:
type: integer
maximum: 2147483647
minimum: -2147483648
created_by:
allOf:
- $ref: '#/components/schemas/User'
readOnly: true
created_at:
type: string
format: date-time
readOnly: true
updated_at:
type: string
format: date-time
readOnly: true
source_url:
type:
- string
- 'null'
maxLength: 1024
internal:
type: boolean
show_ingredient_overview:
type: boolean
nutrition:
allOf:
- $ref: '#/components/schemas/NutritionInformation'
properties:
type: array
items:
$ref: '#/components/schemas/Property'
food_properties:
readOnly: true
servings:
type: integer
maximum: 2147483647
minimum: -2147483648
file_path:
type: string
maxLength: 512
servings_text:
type: string
maxLength: 32
diameter:
type: integer
maximum: 2147483647
minimum: -2147483648
diameter_text:
type: string
maxLength: 32
rating:
type:
- number
- 'null'
format: double
readOnly: true
last_cooked:
type:
- string
- 'null'
format: date-time
readOnly: true
private:
type: boolean
shared:
type: array
items:
$ref: '#/components/schemas/User'
GenericModelReference:
type: object
properties:
id:
type: integer
readOnly: false
model:
type: string
name:
type: string
required:
- model
- name
PaginatedGenericModelReferenceList:
type: object
required:
- count
- results
properties:
count:
type: integer
example: 123
next:
type:
- string
- 'null'
format: uri
example: http://api.example.org/accounts/?page=4
previous:
type:
- string
- 'null'
format: uri
example: http://api.example.org/accounts/?page=2
results:
type: array
items:
$ref: '#/components/schemas/GenericModelReference'
timestamp:
type: string
format: date-time
ShoppingList:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 32
description:
type: string
color:
type:
- string
- 'null'
maxLength: 7
required: []
EnterpriseKeyword:
type: object
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 64
label:
type: string
readOnly: true
description:
type: string
required:
- label
- name
Ingredient:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
food:
allOf:
- $ref: '#/components/schemas/Food'
unit:
allOf:
- $ref: '#/components/schemas/Unit'
amount:
type: number
format: double
conversions:
type: array
items: {}
readOnly: true
note:
type:
- string
- 'null'
maxLength: 256
order:
type: integer
maximum: 2147483647
minimum: -2147483648
is_header:
type: boolean
no_amount:
type: boolean
original_text:
type:
- string
- 'null'
maxLength: 512
used_in_recipes:
type: array
items: {}
readOnly: true
checked:
type: boolean
readOnly: true
default: false
description: Just laziness to have a checked field on the frontend API client
required:
- amount
- checked
- conversions
- food
- unit
- used_in_recipes
RecipeSimple:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
url:
type: string
readOnly: true
required:
- name
- url
RecipeFlat:
type: object
description: Adds nested create feature
properties:
id:
type: integer
readOnly: false
name:
type: string
readOnly: true
image:
type:
- string
- 'null'
format: uri
readOnly: true
required:
- image
- name
SupermarketCategory:
type: object
description: "Moves `UniqueValidator`'s from the validation stage to the save stage.\nIt solves the problem with nested validation for unique fields on update.\n\nIf you want more details, you can read related issues and articles:\nhttps://github.com/beda-software/drf-writable-nested/issues/1\nhttp://www.django-rest-framework.org/api-guide/validators/#updating-nested-serializers\n\nExample of usage:\n```\n class Child(models.Model):\n field = models.CharField(unique=True)\n\n\nclass Parent(models.Model):\n child = models.ForeignKey('Child')\n\n\nclass ChildSerializer(UniqueFieldsMixin, serializers.ModelSerializer):\n class Meta:\n model = Child\n\n\nclass ParentSerializer(NestedUpdateMixin, serializers.ModelSerializer):\n child = ChildSerializer()\n\n class Meta:\n model = Parent\n```\n\nNote: `UniqueFieldsMixin` must be applied only on the serializer\nwhich has unique fields.\n\nNote: When you are using both mixins\n(`UniqueFieldsMixin` and `NestedCreateMixin` or `NestedUpdateMixin`)\nyou should put `UniqueFieldsMixin` ahead."
properties:
id:
type: integer
readOnly: false
name:
type: string
maxLength: 128
minLength: 1
description:
type:
- string
- 'null'
open_data_slug:
type:
- string
- 'null'
maxLength: 128
required:
- name
EnterpriseSocialRecipeSearch:
type: object
properties:
id:
type: integer
readOnly: false
name:
type: string
readOnly: true
image:
type:
- string
- 'null'
format: uri
readOnly: true
keywords:
type: array
items:
$ref: '#/components/schemas/EnterpriseKeyword'
readOnly: true
required:
- image
- keywords
- name
RecipeBatchUpdate:
type: object
properties:
recipes:
type: array
items:
type: integer
keywords_add:
type: array
items:
type: integer
keywords_remove:
type: array
items:
type: integer
keywords_set:
type: array
items:
type: integer
keywords_remove_all:
type: boolean
default: false
working_time:
type:
- integer
- 'null'
waiting_time:
type:
- integer
- 'null'
servings:
type:
- integer
- 'null'
servings_text:
type:
- string
- 'null'
private:
type:
- boolean
- 'null'
shared_add:
type: array
items:
type: integer
shared_remove:
type: array
items:
type: integer
shared_set:
type: array
items:
type: integer
shared_remove_all:
type: boolean
default: false
show_ingredient_overview:
type:
- boolean
- 'null'
clear_description:
type:
- boolean
- 'null'
required:
- keywords_add
- keywords_remove
- keywords_set
- recipes
- shared_add
- shared_remove
- shared_set
RecipeImage:
type: object
description: Adds nested create feature
properties:
image:
type:
- string
- 'null'
format: uri
image_url:
type:
- string
- 'null'
maxLength: 4096
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: Authorization