Looking for sequelize.js REST API generator with associations support - node.js

Is there any node.js module which would provide full REST api sequelize?
Which must follow associations, so for example if I have tables testsuites (hasMany testcases) and testcases, than the api will allow me to do: get /api/testsuite/1/testcases and it will do all the magic for me?
I checked sequelize-restful, but does not seems to work this way :(

See below libraries can help you in generating REST API with sequelize
1.https://github.com/dchester/epilogue
2.https://github.com/sequelize/sequelize-restful
Example: https://github.com/pjanaya/nodejs-express4-sequelize-restful

Related

swagger - extract parameter info from express-validation

I'm new to node, swagger etc.
I'm working on a node.js app, I added some endpoints and using express-validation package I configured validators for my end points.
I now started using also swagger-autogen to generate swagger doc, but I can't find a way to make swagger use the validators in order to provide more data/limitations of the endpoints' parameters.
Is there a way to achieve something like that?
Thanks

what is difference between `django.test.APITestCase` and `rest_framework.test.TestCase` in `python-django`

What is the major difference in these test classes django.test.TestCase and rest_framework.test.APITestCase . which is Better to test my views.py ?
can you suggest me documentations to understand about these.
Thank you in advance. :-)
Difference between rest_framework.test.APITestCase and django.test.testcases.TestCase in HTTP Client they use (source: github).
With rest_framework APIClient it easier to test API than with Django Client. For example, less work with json responses. See more: http://www.django-rest-framework.org/api-guide/testing/
APITestCase in rest_framework.test is to test the api's in the rest. It is specific for the api operations and api calls.
Django.test.TestCase is used to test the Django classes.

what is the proper way to create a swagger web service in TypeScript

I am part of a project written in TypeScipt and I am trying to add TypeScript Web Server which will be compatible with Swagger.
What is the most basic strategy to implement it, considering easy maintainability.
For Typescript I have notice that exists 'Typson' library for generating a JSON Model from TypeScript Interface.
For Swagger, I have tried using 'swagger-node-restify' library, since it supports adding JSON models to swagger.
However, I encounter some problems:
Typson doesn't support typeScript syntax of Import -
(import {Server} from "restify")
I tried to implement the 'swagger-node-restify' example (Pet Example), however the RESPONSE of the localhost:8080/api-docs.json GET Request is missing all the SPEC data of the API.
{"apiVersion":"0.1","swaggerVersion":"1.1","basePath":"http://localhost:8080","apis":[{"path":"/api-docs.{format}/pet","description":"none"}]}
I suggest to describe a Swagger compliant API using yaml or json and to generate the server from that.
swagger-server can build APIs on top of express in real time (no source code generation).
There are JavaScript code generators :
Call the swagger-codegen client with -l nodejs-server
swagger-node is a great alternative but seems hard to integrate with TypeScript
Yes, you can easily generate Swagger and OpenAPI documents from your TypeScript types by using tsoa. The readme contains all of the setup information that you would need to start using it. It's compatible with express, hapi, koa, and more (via the ability to add your own template for your preferred server type):
https://github.com/lukeautry/tsoa
The advantages that tsoa has over other libraries is:
it both generates the swagger/OpenAPI document and it also validates the types at runtime
(Full Transparency: I am one of the maintainers of tsoa. But I was first a consumer of tsoa and I find it to be a great product... that's why I asked to help maintain it! :) )

use Waterline as Standalone (no express)

Good Afternoon,
I am new with node.js and I try to develope an only command app.
For this app I need an ORM and I wish to use WATERLINE as standalone but not in express framework.
I looked at the example and I succeed to see my different collections.
// Our collections (i.e. models):
ontology.collections;
console.log(ontology.collections);
// Our connections (i.e. databases):
ontology.connections;
I am stucked after this. I can't find a way to return my models and make queries.
If someone could help me taht would be great.
Thanks
If you initialized Waterline in the ontology variable and got the collections successfully loaded as you say, now you can access each collection loaded (with loadCollection()) like this:
ontology.collection.mycollection
Where mycollection is the identity defined in your model.
Then you can make queries:
ontology.collection.mycollection.find(...)

How do i access the Phabricator Maniphest restful APIs?

I'm trying to programmatically create tasks/bugs on Maniphest: https://www.phacility.com/phabricator/maniphest/
but i can't quite seem to find a RESTful API that can do this.
am i totally missing out on something? or does there not currently exist one
Conduit (https://secure.phabricator.com/book/phabricator/article/conduit/) should work for you. There is a method called createtask (looks like https://secure.phabricator.com/conduit/method/maniphest.createtask/) that is exactly what you are looking for.
You can access phabricator's api, to create task ,query user info etc.
here is the demo for access https api by postman .
Note: for multi value field such as "ccPHIDs" , you should use format like the image.
but in conduit UI Test. you have to use json format, like this: ["PHID-PROJ-xxx3", "PHID-PROJ-xx12"]
phabricator's API is the wrost api set, I have used by now. so sick...

Resources