This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
Does the file-based mock middleware support cross-file referencing? #173
Comments
AddendaFor the Sample 1 code to work with a file-based database it was necessary a small tweak by me, which wasn't included by default. Source codeIf my question above didn't sound completely clear to you, I'll try to paste some of the
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I couldn't find any hint as to what I'm asking in the Mock middleware doc, so I felt obliged to post. I'm basically asking myself whether the Mock middleware possesses a certain feature.
The prototype of an application I'm writing has the following types of resources: Story, Mission and Activity. A single story contains multiple missions, which in turn may contain many activities. My intent so far has been to use a file-based DB and store all the individual collections in separate
.json
files (actually this is taken care of by the Mock middleware) and have, by way of example, a single Story contain a reference to one or more activities, not an actual JSON payload to the same data (the natural way to achieve this might be to use integer identifiers).I've been inspecting the PetStore.yaml file and the way it is integrated in Sample 1 and what I've seen is that if a resource contains a reference to another resource, the latter is stored not "by reference" (e.g. a numerical id) but "by value" (an entire JSON structure embodied within).
Does the Mock middleware possess this kind of feature, in such a way that I can
GET
/stories/0/missions
for example, or do I need to implement this mechanism by myself?The text was updated successfully, but these errors were encountered: