Can I have multiple Swagger endpoints in a single Web API? - swagger

My Web API has four controllers: Login, Users, Products and Sales. There are also three different client applications and each of these just use a single controller. Administrators have an User Administration app, Managers have a Product management App and customers have a "Buy this" app. So, three different Web API's?
Well, no. As all controllers share the same database so we want it all contained in a single project. They also share some functionality in the background and all APIs also need to support the Login controller.
What I want is that my API has three different URLs:
example.com/Users
example.com/Products
example.com/Sales
These should be three different Swagger endpoints, each with the Login controller. I just wonder if this is even possible or if I need three different projects to get this to work.

Well, I had to find this post about multiple Swagger documents but I managed to get it to work.
It starts with the builder.Services.AddSwaggerGet() where you use options.SwaggerDoc() multiple times to create multiple documents.
Then, using app.UseSwaggerUI() you add multiple endpoints for each doc. specifying the related document names from the previous step.
And with each controller you add [ApiExplorerSettings(GroupName = "...")] to link the controller to a specific document. Without it, they end up in all documents...
The result is that I now have a single project that holds multiple Swagger endpoints and thus multiple Web API's.

Related

when to create different hubs vs group in azure web pub sub

I am bit confused about the right approach or what are the deciding factors to consider when creating separate hubs vs separate groups within a hub.
In my app there are 2 cases where are are using pub sub:
Multiple user have access to same data. In order to avoid overriding changes done by one user by another we use locking mechanism so that only 1 user can edit the data at my given point. Pub sub notifies users if data they are viewing is locked.
We have some long running report generation process and we use pub sub to get state update of the long running process
We currently have single hub created("MY-APP-HUB") for the entire application, and for both of these use cases have separate groups created "LOCK-DATA-[IDENTIFIER OF THE DATA]-GROUP" and "REPORT-[IDENTIFIER OF THE REPORT]-GROUP". Works well no issues there.
However I am wondering if I should create separate HUB for each action so "LOCK-DATA-HUB" and "REPORT-HUB", and then have separate groups created for each data unit. So for eg within "LOCK-DATA-HUB", create a group "DATA-1-GRP", "DATA-2-GRP", similarly "REPORT-1-GRP", "REPORT-2-GRP" for "REPORT-HUB".
I am honestly not sure if I am doing things correctly. At one hand having all messages associated with an app going through a hub makes sense to me and managing just single token is simpler.
But creating hub per action/feature is not bad either. My only concern here would be if multiple application sharing same pub sub have similar actions going on but that could be avoided by adding some application identifier to the hub name I suppose.

Programmatically access Tags in Teams

I am building an application that creates Teams for my training classes and I can Create a Group, make it a team, and then add the required folks to the Members list. I want to be able to differentiate between "students" and "facilitators" for reporting and management.
I have found /api/v1/teams/{0}/memberTags/ but I don't seem to be able to call it directly or find it in the SDK documentation.
Is this API available?
Teams Tags are currently in the Graph beta
https://learn.microsoft.com/en-us/graph/api/resources/teamworktag
Tags provide a flexible way for customers to classify users or groups based on a common attribute within a team. For example, a Nurse or Manager or Designer tag will enable users to reach groups of people in Teams without having to type every single name.
Tags are scoped at the Team level.
When a tag is added, users can #mention it (#tag) in a channel in that team . Everyone who has been assigned that tag will receive a notification just as they would if they were #mentioned individually. Users can also use a tag is to start a new chat with the members of that tag.
No, there’s no API for this now .
Check here to Manage tags in Microsoft Teams app. We will keep you posted once this feature is available through API.

How to split functionality into separate apps iOS?

I am working on an app that serves two different types of user. Both users have some common functionalities.
One group is the general public, who uses the app to navigate basic events or request for new events.
The second group is who can provide services to the general public (can be paid or unpaid). They primarily access the profiles created by general users. They can add details, e.g. notes about conversations with them.
Now we want to divide both the users because the app is getting quite large and at any time user can be part of one group only.
How can I create separate apps?
Using different targets for each group is it a better solution? I tried this but it is not helping us to reduce app size.
Creating separate project will make maintaining challenge because both uses have some common functionalities.

Rails 3.2 form for one-to-many relationship

I have the following models:
User
Apps
Service
Apis
A User has a list of Services he/she can access.
When creating an App I need to be able to add/remove services to it based on the Services a User can access. The same applies for editing an App.
We are using simple form. The association method is great for displaying Services with a checkbox to add / remove from the App.
The problem we face is that Services have Apis and we need to display information related to the Apis under a Service. A User still needs to be able to select a Service to add/remove from an App, as well as display information about it's Apis below.
It's seems the association method in simple form does not support the functionality we need to display information related to Apis in addition to being able to add/remove an Service from an App based on the User's list of Services he/she can access.
We have spent some time trying to figure out how to solve this problem e.g., nested forms, array parameters, simple form api, etc.
I would think there would be a Rails way to do this.

Multiple schemas in Gmail

Is it possible to embed multiple GMail schemas in a single email? I'd like to provide users the ability to retry or cancel an action (the cancel operation would perform some cleaning stuff in the server app). However, if I try to embed more than one script, only the first one appears in the inbox (each script is correct and shows up properly when it is the only one).
Only one action is currently supported and if you include multiple actions, the first one will be used. The user experience for exposing multiple actions would be really different, so if/how to handle them is still being discussed.

Resources