swagger-angular-generator | Generator of API layer in TypeScript for Angular 2 apps | REST library
kandi X-RAY | swagger-angular-generator Summary
kandi X-RAY | swagger-angular-generator Summary
Generator of API layer in TypeScript for Angular 2+ apps
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of swagger-angular-generator
swagger-angular-generator Key Features
swagger-angular-generator Examples and Code Snippets
Community Discussions
Trending Discussions on swagger-angular-generator
QUESTION
I'm currently working with an API that's a bit of a pain :D The API doesn't return full information needed for my app and that means I have to make multiple calls to get the full information required. Also, I'm struggling to keep my head round it so if it's not well explained just let me know!
Main Details of Issue
The current API flow looks a little like this:
Get a list of 'Group ID's' (see response 1).
Using that list, for each Group ID, get the Group Details and Types in the Group (see response 2).
Using the group details, for each type, get the type name (see response 3).
Build a big tree with all the details.
Using a separate end point, get all 'skills' and update the tree accordingly (see response 4).
The problem comes when trying to return the correct values in the correct place which is all out of sync since I'm nesting promises in promises in async promises :O
The main API endpoints and examples can be found at https://esi.tech.ccp.is/latest/.
My current code looks a little like the below (I've tried to list functions in the order they are called).
The problem is, I need to locate the point where:
The list of groups has been returned.
For each group the types included have been returned.
the skillTree object has had a new property added which is under the format below.
Skill Tree Aim:
...ANSWER
Answered 2017-Dec-18 at 14:46You should make use of Observables, because Observables are cold, so you can create them, store them in an array, and then combine the results so your http requests are fired at the same time, gathering details for everything you need.
Here is, in pseudo-code (as I won't copy the whole implementation you have), an Observable chain solving your problem:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install swagger-angular-generator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page