RIAK and Swagger UI - swagger

I am learning about RIAK and thinking about using it to store JSON objects.
I have also used swagger UI many times in the past to document API's.
I would like to build a simple example bucket in RIAK with a swagger UI style API. This could be simple out of the box functionality. All I need to do is define a model for the JSON object and it should be possibly to automatically create a swagger file with get, post, put options for that object.
I have googled "swagger Riak" but I can't find any articles with both words in them.
Is there a better phrase I should be searching for?

Related

Using Swagger UI Express / #nestjs/swagger, What is best practice to edit API response codes, descriptions and other properties

So I currently already have the swagger UI set up with the page and everything, but I want to edit the .json file (so I can provide descriptions, error codes and stuff but all in one document). Was just wondering where I should be locating my swagger.json or swagger.yaml file to be able to adjust the API??
If not, what's the best practice for documenting parameters, response codes and descriptions WITHOUT having to do it tediously one by one like below...
Any advice on using swagger with nestjs applications would be much appreciated :) Still very new with using it

How can I define a complex structure shared across multiple endpoints with flasgger

I'm trying to create swagger documentation for an existing codebase which has a complex JSON request structure and a complex JSON response structure shared across multiple endpoints. I'd like for these structures to appear in the swagger UI, and I'd like to avoid repeating definitions (because the structure involves several hundred-plus item enums and is also recursive). For the same reason, I'd also like to avoid sticking everything in a single enormous yaml file and using the template hack.
Swagger 2.0 has a "definitions" section outside of the namespace of a particular endpoint for defining JSON fragments that can be used across endpoints, but it is unclear how to define that section using flasgger.
What is the best way to expose these complex structures through flasgger?

Using schema annotations in Xforms

(I'm using Orbeon Forms 2019.2.0.201912301747 CE). I have a bunch of XForms for which the schemas are in a JAR file in orbeons "WEB-INF\lib". (I am able to get individual schemas using the "oxf:" protocol).
XML Schema has "annotations/documentation" and "annotations/appInfo" elements (intended for use by the application) and I swear that in the past I've read how to access these in XForms, but searching online I can no longer find any information about it! I'd like to find out if I can use "appInfo" in the schema to store text presented to the user (xforms alerts or hints), instead of breaking it out into a separate xml file. (The reason being that subsequent versions of the schema might have this text change, and an XSD documenter can pick up this information.)
I remember it being something pretty simple. Is there someone here who does this? Does it work with Orbeon?
The possibility that comes to mind would be to load the XML Schema into an XForms instance. This is possible because the XML Schema is in XML as well. Then you can refer to various parts of the Schema with XPath in labels, hints, etc. You just need, of course, to know the path to those elements in the XML Schema file.

.NET Swagger (Swashbuckle): How to handle requests with a very large amount of parameters

We are using OpenAPI to document our APIs. A few of our calls have a very complex structure with nested classes of nested classes with possibly circular references. This is acceptable and required for the actual API. However, the documentation for these endpoints is almost unusable.
We are using swashbuckles .NET-integration to dynamically generate the documentation at startup and scraping the afterwards if there's a need for static documentation.
I have read about using $ref according to swagger specs but I'm not sure this is the use case for it.

Send data to XForms

I am trying to use an XForms document that creates an instance from a different XML document depending on a request parameter or header. I can't find a way to do it without using Orbeon's xxforms:get-request-parameter().
Orbeon also suggest this:
<xforms:instance id="user-data" src="input:instance"/>
I might be able to use this (assuming BetterForms supports it) but I need multiple XML documents as inputs. I may be able to rig up a way to put all the XML documents into one post XML fragment, but that's not much fun either.
I originally tried generating the XForms as the return of an XQuery document with request:get-parameter() but I'm running into problems with it. Is there something I'm missing or are these methods the only good ways to send stuff to XForms?
At this point, it looks like your choices are as follows:
With Orbeon Forms, use the Orbeon's extension XPath functions to access the HTTP request.
With Better Forms or XSLTForms, contact the authors to see if they can implement the standard URI functions introduced in XForms 2.0.

Resources