openapi: 3.2.0 info: title: Tandoor Unit Conversion 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: Unit Conversion paths: /api/unit-conversion/: get: operationId: apiUnitConversionList description: logs request counts to redis cache total/per user/ parameters: - in: query name: food_id schema: type: integer description: ID of food to filter for - 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 that looks into food, base unit or converted unit by name tags: - Unit Conversion security: - ApiKeyAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedUnitConversionList' description: '' summary: Api unit conversion list x-summary-source: derived post: operationId: apiUnitConversionCreate description: logs request counts to redis cache total/per user/ tags: - Unit Conversion requestBody: content: application/json: schema: $ref: '#/components/schemas/UnitConversion' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/UnitConversion' multipart/form-data: schema: $ref: '#/components/schemas/UnitConversion' required: true security: - ApiKeyAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/UnitConversion' description: '' summary: Api unit conversion create x-summary-source: derived /api/unit-conversion/{id}/: get: operationId: apiUnitConversionRetrieve 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 unit conversion. required: true tags: - Unit Conversion security: - ApiKeyAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/UnitConversion' description: '' summary: Api unit conversion retrieve x-summary-source: derived put: operationId: apiUnitConversionUpdate 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 unit conversion. required: true tags: - Unit Conversion requestBody: content: application/json: schema: $ref: '#/components/schemas/UnitConversion' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/UnitConversion' multipart/form-data: schema: $ref: '#/components/schemas/UnitConversion' required: true security: - ApiKeyAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/UnitConversion' description: '' summary: Api unit conversion update x-summary-source: derived patch: operationId: apiUnitConversionPartialUpdate 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 unit conversion. required: true tags: - Unit Conversion requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedUnitConversion' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedUnitConversion' multipart/form-data: schema: $ref: '#/components/schemas/PatchedUnitConversion' security: - ApiKeyAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/UnitConversion' description: '' summary: Api unit conversion partial update x-summary-source: derived delete: operationId: apiUnitConversionDestroy 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 unit conversion. required: true tags: - Unit Conversion security: - ApiKeyAuth: [] responses: '204': description: No response body summary: Api unit conversion destroy x-summary-source: derived components: schemas: 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 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 PaginatedUnitConversionList: 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/UnitConversion' timestamp: type: string format: date-time UnitConversion: type: object description: Adds nested create feature properties: id: type: integer readOnly: false name: type: string readOnly: true base_amount: type: number format: double base_unit: $ref: '#/components/schemas/Unit' converted_amount: type: number format: double converted_unit: $ref: '#/components/schemas/Unit' food: allOf: - $ref: '#/components/schemas/Food' open_data_slug: type: - string - 'null' maxLength: 128 required: - base_amount - base_unit - converted_amount - converted_unit - 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: [] 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 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 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: [] 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 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 PatchedUnitConversion: type: object description: Adds nested create feature properties: id: type: integer readOnly: false name: type: string readOnly: true base_amount: type: number format: double base_unit: $ref: '#/components/schemas/Unit' converted_amount: type: number format: double converted_unit: $ref: '#/components/schemas/Unit' food: allOf: - $ref: '#/components/schemas/Food' open_data_slug: type: - string - 'null' maxLength: 128 securitySchemes: ApiKeyAuth: type: apiKey in: header name: Authorization