Git Product home page Git Product logo

angular-swaggerific's People

Contributors

biyincai avatar brianclogan avatar jfache avatar tusharghate avatar tyler-boyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

angular-swaggerific's Issues

can I see an example of this used inside an angularjs app?

I don't quit understand how to create and use the service. Really neat idea making the API dynamic like this.

It would be very helpful if you could include a simple sample app where the swagger is in a file, there is a service and a controller using the service.

Unable to run the tool

Hi,

I got "TypeError: Cannot read property 'addPet' of undefined" when running this tool. I attached my code below. The pet.json file is copy&paste from your swagger JSON sample in http://traderev.github.io/angular-swaggerific/.

Also, If I use <script src="bower_components/angular-simple-sprite/angular-swaggerific.min.js"></script> as suggested in your documentaion, I got the error "TypeError: AngularSwaggerific is not a function". But if I change to angular-swaggerific.js I don't see that error any more (but I got the "TypeError: Cannot read property 'addPet' of undefined" error mentioned above.

Could you give any advice?

<script src="angular/angular.js"></script>
<script src="angular-swaggerific/dist/angular-swaggerific.js"></script>
<div ng-app="myApp" ng-controller="petCtrl">
<script>
var app = angular.module('myApp', ['angular-swaggerific',]);
app.controller('petCtrl', function($scope,$log, $window, AngularSwaggerific) {
var mySwaggerAPI = new AngularSwaggerific('pet.json');

    mySwaggerAPI.pets.addPet({"id": 1})
    .then(function(data) {
        $log.log("Success! " + data);
        console.log("success");
    }, function(err) {
        $log.log("Error! " + err);
    });
});
</script>

Get Params not creating a query string

When you run a GET with data, for instance:

GET google.com
Data: {"q": "search"}

It doesn't put the data in the URL as a query string. That appears to be a limitation of what Angular does. Is there a way to use GET with data and populate the query string?

How I can use simple apiKey?

Well in my case, I need set an api key. In swagger I use securityDefinitions and security. Example:

{
    "swagger": "2.0",
    "info": {...},
    "paths": {
        "/users": {
            "get": {
                "description": "List all",
                "parameters": [...],
                "responses": {...},
                "security": [
                    {"token": []},
                    {"session": []}
                ]
            }
    },
    "securityDefinitions": {
        "token": {
            "type": "apiKey",
            "description": "Application API key",
            "name": "apikey",
            "in": "query"
        },
        "session": {
            "type": "apiKey",
            "description": "Temporal session",
            "name": "session",
            "in": "query"
        }
    }
}

When I try with

// based on $rootScope.myApi.{namespace}.{operationId}(...)
$rootScope.myApi.users.all({
    apikey   : "4234kl23423lk4hh3k",
    session : "hjk324hkh4232m341"
})

This not apply apikey and sessionon query url.

P.S: I truncate params and another properties to shorter example.

Add support of query params

The params in "query" are not supported. This features is required for optionnals parameters.

This is a sample of query paramters in swagger :
{name: "keyWord", in: "query", description: "The key word.", required: false, type: "string"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.