Parse recipes upon outputting instead of parsing

Open
#1,087 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
php
Domain
api, backend

Research direction

Start by mapping the recipe import and saving flow, then inspect how the API endpoints currently parse and format recipes. Define the minimal information-preserving import model and a separate output structure; done means existing recipe information survives import and the API can support additional formats.

Written by the indexing model from the issue text.

Description

Backend enhancement maintenance

Currently, we are parsing the recipe in a strict manner and trying to format it according to our needs. This might throw away information that is lost after the initial import and cannot be restored.

We should only do minimal parsing during the import and saving of recipes. Instead, we should have a clear structure on how to generate a well-suited output of the API endpoints. That will allow us to support other formats as well (see e.g. #138 #831 etc).

I am aware that this is a big undertaking but this might help to build a better understanding in the long term.

I assume it would be a good approach to generate an internal data structure that is simpler to use and parse than plain arrays in PHP. It might be favorable to implement a Visitor pattern on an abstract syntax tree to generate the solution.

Dominant language
HTML
Stars
642
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/cookbook

All issues in nextcloud/cookbook

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.