Fork me on GitHub
#reitit
<
2019-06-25
>
ikitommi08:06:50

@plins you can add spec meta-data :swagger/example or it’s parent :json-schema/example for the spec to set those manually. Using generators would be awesome here, also for creating api stubs without actual handlers, I recall there is a help wanted issue on reitit from this 🙂

👍 1
plins20:06:40

So the specs should be defined via spec tools instead of the vanilla lib?

ikitommi08:06:28

@abdullahibra I think we haven’t used localstore with Match, and you are right, there can be non serializable data, but that’s a common case for the app-db anyway, right? You could persist only the parts that identify the route, which is either: 1) dissoc the Match and store just a full uri, with query-string, apply routing when deserializing with the full uri retain the full Match in memory 2) just keep the route name or uri + coerced query / path parameters.

ikitommi08:06:13

if your goal is to store the state between different browsing session, storing just the full uri could make more sense => if you use controllers, they need to be re-fired when the state is restored from localstore => automatic when just recalculating the page from the uri.

ikitommi08:06:37

at least we have a ton of computed data in the app-db after everything is loaded, doesn’t fit in the localstore, so we could just persist the base data, from which everything else can be calculated / fetched.

ikitommi08:06:39

hope this helps.