ben.knoble
2021-12-1 15:39:47

Design-level question: I have an API spec from which I can generate racket code (swagger + mustache templates, I think). The API lives on different hosts—most of the time, the client specifies that they want a particular host (and the racket package implementing the client requires this) . But some API routes have reasonable defaults (e.g., a random host or all of them in a particular subset). I would like the racket package to, when the host is not specified, if a default is available, use it.

The problem is, I don’t think mustache templates are powerful enough for this (the mapping of routes to default host types is external to the spec).

How would you solve this? Vote with emoji and/or comment 1. Find a way to include the default metadata in the swagger spec so that code generation can use it. 2. Wrap the generated code by hand, and maintain it carefully. 3. Fix the API (how?). 4. Something else.


capfredf
2021-12-2 01:43:05

@mflatt quick question: to disable stripping debug symbols, Opensuse’s Racket package has this https://build.opensuse.org/package/view_file/devel:languages:misc/racket/dont-strip.patch?expand=1\|patch, but I don’t think it is necessary, since configure --disable-strip does the trick. Do I get this right?


mflatt
2021-12-2 02:05:03

Yes for v8.3. That repair/improvement to --disable-strip is from August of this year.