I'm using Dart, and i want to implements swagger-ui, as a web on my proyect.
I have the json/yaml file of my API and that API running on local.
The JS+Css+Html Option of swagger-ui works fine, but, is there a way to generate a web like this in Dart?
I guess I am confused what you want to do.
Dart has it's own documentation generator, dartdoc, that works out of the box for any package. I don't know of any support for swagger or if it offers any particular advantages for Dart users.
An example for args package:
https://www.dartdocs.org/documentation/args/0.13.7/index.html
Related
I have a bunch of APIs that are documented as OpenAPI v3 specs.
Eg: foo.yaml, bar.yaml and baz.yaml
I also have a Web server that displays the specs in the swagger ui, so all my swagger models are easily consumable by devs, designers and so on.
My question: is there an easy way, using the javascript console, to give me a list of the resource paths?
I've had a quick look around the swagger ui source code but couldn't find anything useful, other than the SwaggerUIBundle object.
The API definition is accessible via ui.specSelectors.specJson(). The value is an Immutable.js Map.
You can use the following code to list all the paths:
let paths = ui.specSelectors.specJson().get("paths")
paths.mapKeys(key => console.log(key))
I am setting up an automation, and wanted to ask if there is an API to import Vorto models. Right now, it looks like it is only possible via the website (https://vorto.eclipse.org/#/import).
At https://www.eclipse.org/vorto/swagger/ there is a 'Vorto Importer Plugin API'. I guess this API is only for importing plugins as the name suggests.
If this is not available, are there any plans to implement such a function?
currently the Repository API of Vorto 0.11 does not support to import models via REST. It is a pure read-only REST API. You can "only" import models via the Repository Web Interface (https://vorto.eclipse.org)
However there is a GitHub issue about your request: https://github.com/eclipse/vorto/issues/1667 and it will be available in 0.12 Release, which is planned for end of august.
The Vorto Importer Plugin API is an API to implement an Importer Plugin that you can register with the Vorto Repository. An Importer plugin could for example be a Web Of Things or JSON Schema Plugin, that converts these 3rd party descriptors to Vorto Information Models. As I understand your question, that is not what you wanna do :)
I've developed a REST API anotated with Swagger annotations.
I've been able to show the api documentation on a swagger-ui application, very nice.
The problem:
I'm trying to generate clients acording this specification using the url provided by swagger acording my anotations.
The porblem is it seems to be imcompatible, or at least, I don't see how to do the swagger editor reads my url and from then on, generate clients. But swagger editor reports me about some errors...
It's possible to integrate my anotated swagger api with a swagger editor?
Thanks.
The question seems a bit confusing.
If you are trying to generate clients from your REST API Swagger spec, then you should take a look to Swagger-Codegen project.
Description of project:
swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.
Link to repository: https://github.com/swagger-api/swagger-codegen/
Link to official page: http://swagger.io/swagger-codegen/
Not sure if I understand the question correctly. If you want to generate API clients online, you an use http://generator.swagger.io (besides http://editor.swagger.io). Here is an example to generate API client for Java:
curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' http://generator.swagger.io/api/gen/clients/java
Swagger editor is used only for editing a swagger spec in either json or yml format. It does not deal with swagger annotations in any way. However, some of the server skeletons that are generated on the swagger-editor website contain annotations. The annotations are a way of reverse engineering your API to generate a json file so that swagger UI can render a webpage based on the public url path to your swagger.json file.
If you are maintaining a swagger spec json file anyways, the annotations aren't really needed, you might as well just serve up the raw swagger.json itself, rather than the json that is generated by the annotations.
As to your question, "Is it possible to integrate your API with swagger editor?"... Anything is possible, but I'm not sure as to how or why you want to integrate them.
Assumed that I code some type of library and convert it to js (per dart2js). How can I access the prototypes to create objects? What is right way to resolve dart-namespaces?
You can expose functions to JavaScript
Expose Dart functions to javascript
Dart SDK 0.8.10.3_r29803 dart:js callbacks
Using Dart with JSON Web Services (it's used for JSONP)
see also js library
I don't think there is a way to expose classes to JavaScript, but I'm not sure about this.
I'm using schema-first web service development approach by hand-coding WSDL/XSD and then feeding it to svcutil tool to generate .NET data and service contracts. I've tried to introduce WS-Addressing into my WSDL by including "UsingAddressing" element both directly into binding and as WS-Policy import. Policy import is ignored, but I get the following error, when "UsingAddress" is included directly into WSDL binding: "WSDL extension element "UsingAddressing" from namespace 'http://www.w3.org/2006/05/addressing/wsdl' was not handled".
According to MSDN, "UsingAddressing" element is supported by WCF (http://msdn.microsoft.com/en-us/library/ms996497.aspx), so is it so, that this element is not supported by svcutil?
For anyone coming across this, I had the same problem trying to generate a proxy with svcutil. I had to generate the proxy via VS2017 and it worked.