How do I generate a client from OpenApi documentation made by OpenApi Generator? - openapi

I am looking at these API docs https://developers.arcgis.com/workflow-manager/api-reference/rest/ which appear to be made by OpenApi Generator (some links at the bottom).
I want to generate a C# client using the openapi-generator-cli which requires a YAML file as input. How do I get that YAML file out of those docs?

I ended up asking Esri: https://community.esri.com/t5/arcgis-workflow-manager-questions/is-there-a-spec-for-wm-server-api/m-p/1240965#M1763
https://<server>/<webadaptor>/workflow/doc/swagger.json

Related

Best way how to publish OpenAPI document on GitHub (readme.md)?

I have a project hosted on GitHub. To document the API I am using the OpenAPI spec. Now I want to add a link on readme.md (on GitHub) that refers my visitors to the OpenAPI document for good user experience.
Far as I see I have two solutions:
http://editor.swagger.io/?raw=https://raw.githubusercontent.com/path/to/file.yaml
https://app.swaggerhub.com/apis/(username)/(api-name)/(api-version)
Both approaches are working, but they both open with an editor on left side that shows the content of YAML file and is, IMHO, wasting a significant screen space. Not really what I want. Is there an option to display the OpenAPI document without editor opened? Just similiar what is done for https://petstore.swagger.io/ which comes without editor opened.
Or ... is there maybe an option available to display the OpenAPI document on GitHub directly?
Thanks, Christoph
If you use SwaggerHub, replace /apis/ with /apis-docs/ in the URL to view just the API docs without the editor part. For example:
https://app.swaggerhub.com/apis-docs/swagger-hub/registry-api/1.0.47
Or if your OpenAPI definition is hosted elsewhere (e.g. on GitHub), you can use
https://petstore.swagger.io/?url=https://path/to/file.yaml
to load it into the public Swagger UI demo. Swagger UI renders API docs without the editor part.

How to render a pipeline graph in Beam?

Using Apache Beam Python SDK version 2.9.0, is it possible to get a renderable pipeline graph representation similar to Google’s dataflow instead of running it?
I have difficulties to assemble complex pipelines and I would be happy to see an assembled pipeline before trying to execute it using DirectRunner.
Have a look at this unit test. This should give you an example of how this works with Python SDK. TextRenderer simply returns the dot representation in text format.
There is also an explanation for how to do it and how to handle DOT files, but it is written for Java SDK (link). However, it should give you an idea how this can implemented, and the part about DOT files there is language agnostic.
You might also want to have a look at PyDot package to see how to handle the output programmatically in Python.

How call rest api with file in PowerBuilder

I works on PowerBuilder application and I need develop solution which call REST Apis
This Apis need several parameters and one file, with post method.
I do not found any sample of this.
Can you help me?
Don't know which version of PowerBuilder you are using. PowerBuilder 2017 R3 has an HTTPClient object as well as a RESTClient object and it supports Base64 encoding (what you would use to turn binary data into JSON compatible). There are numerous code examples on the Appeon Website so rather than copy n' paste them all here suggest you look through those various examples and find one that meets your needs: https://community.appeon.com/index.php/codeexchange/powerbuilder?start=120

How Can I Make Spring Rest Docs Look Like Swagger?

I have started to use Spring Rest Docs for a project but other APIs in the company are still using Swagger/OpenAPI which has led to a style inconsistency.
The usual Swagger view (e.g. https://petstore.swagger.io) has collapsible sections for each url and CSS colouring GET/POST/PUT/DELETE etc.
I should be able to customise the asciidoctor with a line in the adoc
:stylesheet: custom.css
Is there an existing template for Spring Rest Docs that gives an output similar to what the default Swagger output looks like?
Can you add javascript to the asciidoctor output to animate some of the documentation like collapsible url sections?
This is really any Asciidoctor question so you might want to tag it as such.
Is there an existing template for Spring Rest Docs that gives an output similar to what the default Swagger output looks like?
Not that I am aware of.
Can you add javascript to the asciidoctor output to animate some of the documentation like collapsible url sections?
Yes, you can add JavaScript to the HTML that's generated by Asciidoctor. One approach is described in the answers to this question. Another approach is to use a DocinfoProcessor to inject the JavaScript into the <head> of the generated HTML. One advantage of the latter approach is that it allows the functionality to be packaged as a dependency and reused. You can see an example of a fairly simple DocinfoProcessor here.
Take a look at this Github project: https://github.com/ePages-de/restdocs-api-spec
A few teams at my company are using this to generate OpenAPI documentation from our Sprint Rest Doc tests.

Marklogic REST API - Retrieve File Content

I'm currently working to build an app on top of a MarkLogic database of XML documents. These are news articles in NEWSML-G2 format. I'm using a REST API that I created in the Information Studio to access the database. Using the /search API call, I can retrieve a set of documents matching with the keyword. I would like to apply an XSLT and display these as a list, with the title of each article being shown. I've looked through the MarkLogic documentation and elsewhere, but could not find relevant material. Any help is greatly appreciated. Thanks!
Krishna:
If you're using MarkLogic 7, you can do the following:
First, Create query options that extract the title of each document:
http://docs.marklogic.com/guide/rest-dev/appendixb#id_94425
http://docs.marklogic.com/REST/PUT/v1/config/query/%5B%27default%27-or-name%5D
Then, install your XSLT transform on the REST server:
http://docs.marklogic.com/REST/PUT/v1/config/transforms/%5Bname%5D
Finally, specify your query options and your XSLT transform to modify the search response:
http://docs.marklogic.com/REST/GET/v1/search
Hoping that helps,
Erik Hennum