bahmutov / bahmutov/iframe-api
Swagger support?
- Dominant language
- JavaScript
- Stars
- 36
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
HI,
Have you thought about adding Swagger support for this?
1. Design the API using http://swagger.io/
2. Build host and iframe client libraries using _yet_not_existing_swagger_iframe_api_builder_
If client calls iframeAPI method 'bar'
``` js
iframeApi.bar('something').then(function(){
});
```
then adding your code in to that inside iframe could be
``` js
// inside iframe
iframeAPI.on('bar', function(promise?Event, arg1) {
console.log(arg1)
});
```
This is only idea and haven't thought about this in deeper. This would allow you to write the API using swagger spec and it would generate the client js and your logic would be attached using promise.then() and event .on('myAPIfunc', funcition)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.