Make available my swagger APIs to be read through swagger-ui (new swagger-node project) - swagger-ui

I am using the Swagger Node project with Express 4 to build my apis. https://github.com/swagger-api/swagger-node
I can make my "swagger api" work, however I could not get expose my apis as JSON to be read by the Swagger-UI(https://github.com/swagger-api/swagger-ui).
How can I achieve it? I know that the previous version I need to use the following method:
swagger.configureSwaggerPaths("", "/api-docs", "");
But with the changes in the project, I dont what to call..
Ty

Maybe look into swagger-tools offered by Apigee-127, i believe this is the best module for node/swagger integration

Related

ServiceStack - Post Files Async using JsonServiceClient

I've trying to POST a single file from one service to another as a stream using an IServiceClient (I'm using the JsonServiceClient). I can achieve this by using code similar to:
using (IServiceClient serviceClient = new JsonServiceClient(myBaseUrl)
serviceClient.PostFile<TResponse>(relativeOrAbsoluteUrl, fileToUpload, fileName, contentType);
I see from an old SO post that there is a JsonHttpClient that I can't seem to find anymore - gone in favour of the JsonServiceClient?. That had an equivalent async method to achieve the same thing as my code example, but I can't see any way to do this using ServiceStack in the latest version ServiceStack (6.1.x).
Is there a recommended (ServiceStack) way to do this which supports async/await, or do I need to roll my own implementation (only way I can think of doing this will be to use the HttpClient and specify a MultipartFormDataContent on the request)?
The recommended ServiceClient for .NET 6+ is to use is the JsonApiClient which has a number of APIs to Upload Files from C#.

Orocommerce - generate API client libraries

I am quite new in the orocommerce ecosystem, and I would like to generate API client librairies automatically for orocommerce API (frontend and backend). The objective is to build my own UI.
I found some dependencies on NelmioApiDocBundle than could potentially generate swagger file, but I hit multiple problems:
this is a quite old version, that only support swagger 1.2
the generated file (using symfony run php bin/console api:swagger:dump /tmp/api/) seems not working with swagger codegen "as is"
all the part of the API seems not written using NelmioApiDocBundle annotation
I am wondering if there is an other mechanism to generate API client librairies for orocommerce. I would like a SDK for typescript.
Thanks in advance for your answer.
Right now, the only supported swagger version is 1.2, as you stated.
By default, the api:swagger:dump command works with an outdated API, to generate data for the current API, run it with --view=rest_json_api option:
api:swagger:dump --view=rest_json_api
As an alternative to the API client generation, as Oro API strictly follows JSON.API standard, you can use many existing client libraries, compatible with the JSON.API specification. The list of Typescript implementations can be found at the official website: https://jsonapi.org/implementations/#client-libraries-typescript

NRWL + NestJS Trying to use Swagger plugin

I am using NRWL, I used it to generate a Nestjs + angular app, however, I am missing the Nest-cli.json file where I am trying to add the line "plugins": ["#nestjs/swagger/plugin"] For the swagger properties. Does anyone know how to Add the nest-cli.json as required in this tutorial: https://docs.nestjs.com/openapi/cli-plugin
Seems like there is already an open BUG #2147 for the same issue and there are multiple solutions presented in the long on going discussion but none of them are full proof and some have side effects. Nonetheless I would highly recommend you to read discussion and monitor it.

Hyperledger Composer: Where is the Open API Specification generated by composer-rest-server stored?

I want to use the specification in to generate a Java client using swagger codegen in order to consume the REST API from a Java application. Where do I find the Open API spec after I start the composer-rest-server? I've tried looking it up but I can't figure out where that file is stored after it is generated.
By default, the docs are at your localhost:3000/explorer
This is generated automatically by the LoopBack framework.
You should carefully follow: https://hyperledger.github.io/composer/integrating/getting-started-rest-api.html

Setting Jira Projects Type, Workflow and Screens Scheme Via API

I am running JIRA 6.1 and I'm trying to use the API to create a new project. Since JIRA 6.1's Rest API doesn't support creating a project I'm using the Soap API.
Note I'm doing this using the Atlassian .net SDK, but I imagine the solution is irrelevant to that.
I have managed to create the project no problem, but I am now trying to set the following schemes in the project
Issue Type
Workflow
Screens
As far as I can tell the 6.1 Soap API (and the 7 Rest API) doesn't actually allow you to modify these schemes, only allowing you to set the Permission, Security and Notification schemes - https://docs.atlassian.com/jira/REST/latest/#api/2/project-createProject
Is that the case or am I missing something?
If it is possible to set the scheme's I want, does anyone have any examples I could base my work off?
Thanks
Got an answer from Atlassian support, and as I suspected this isn't possible.
No, you're correct, the SOAP and REST APIs do not have those
functions.
You're going to need to write type-2 add-ons to provide the functions
you need if you're going to do this remotely, but with the caveat that
if you're willing to do that, you will probably find it a lot easier
to simply write add-ons that do all the work instead of just providing
the external hooks. (Let's put it this way - I was able to code
post-functions to create an entire customised project for JIRA 4 in a
couple of days. Versus a week to add a single SOAP call for feeding
back some simple user data)
I won't mutter too much about using SOAP - I'm assuming you know it's
dead, gone and mostly pointless to code for
Of course, there is the CLI plug-in which I think I'd be silly to ignore
JIRA Command Line Interface (CLI) support this for 6.1 through 7.0
including setting schemes that are not supported by SOAP or REST
except for screens. See the createProject action for details of what
is supported.
Starting from Jira 7.0.0, we can use Create project REST API [POST /rest/api/2/project]
which also allows setting following schemes while creating the project,
issueSecurityScheme
permissionScheme
notificationScheme
workflowSchemeId
Sample Request Payload:
{
"key": "EX",
"name": "Example",
"projectTypeKey": "business",
"projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-project-management",
"description": "Example Project description",
"lead": "Charlie",
"url": "http://atlassian.com",
"assigneeType": "PROJECT_LEAD",
"avatarId": 10200,
"issueSecurityScheme": 10001,
"permissionScheme": 10011,
"notificationScheme": 10021,
"workflowSchemeId": 10031,
"categoryId": 10120
}
For issuetype and screen schemes, there is no such parameter available which can be set using the above create project rest api.
You can also try to use the following Rest endpoint to create jira project using shared configuration which will allow you to reuse all schemes which are present in the template project.
/rest/project-templates/1.0/createshared/{{projectid}}
More information on the Jira rest API can be found at https://docs.atlassian.com/software/jira/docs/api/REST/8.9.0/#api/2/project-createProject
You can try the following curl request for creating jira project
curl -D- \
-u admin:sphere \
-X POST \
-H "X-Atlassian-Token: nocheck" \
-H "Content-Type: application/x-www-form-urlencoded" \
"http://localhost:port/rest/project-templates/1.0/templates?projectTemplateWebItemKey=com.atlassian.jira-legacy-project-templates%3Ajira-blank-item&projectTemplateModuleKey=com.atlassian.jira-legacy-project-templates%3Ajira-blank-item&name=SECOND+Create+from+REST+API&key=CFRAPI&lead=admin&keyEdited=false"

Resources