Giter Club home page Giter Club logo

api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

Issue with requesting api rest

if I Use this it works; print all Json array

$api->rest('/customers', new Customers($db));

but if I use this, it does not work why? it print empty Json array

$api->rest('/customers', function() use($db) {
$c = new Customers($db);
$c->setLimit(20);
return $c;
});

any ideas?

URL params (?param1=somevalue) mess up rest patterns

Hi,
when passing URL params to the api, the Api->rest() does not work as supposed. Furthermore, if the last part of the pattern is a variable (e.g. :id), the URL params are added to this variable

pattern setup: 
$this->rest('/bookings', new Booking($this->app->db));

This request is not recoqnized:
www.mydomain.com/api/bookings?access_token=123456

DELETE www.mydomain.com/api/bookings/3?access_token=123456
=> id which should be 3 becomes 3?access_token=123456

My proposal:

  • remove all URL params from $this->path and store them seperately. Tested, works for the 2 cases above.

error: charset malformed JSON... this happen with columns fields from db with specials characters... any fix?

I have a table with a column text with French and Spanish characters and the JSON returned from the API gives me error

Fatal error: Uncaught InvalidArgumentException: Unable to encode data to JSON in Zend\Diactoros\Response\JsonResponse: Malformed UTF-8 characters, possibly incorrectly encoded in /Applications/MAMP/htdocs/www/cpanel_tripsbro/vendor/zendframework/zend-diactoros/src/Response/JsonResponse.php:164 Stack trace: #0 

I think the issue it is the charset problem... my table is utf-8 charset in the db and header and html charset is ok but the issue it is from the API returning malformed Json when the column has accents in the field to show...

is there a way to set charset when using the line below?
$db = new \atk4\data\Persistence_SQL connection here?

or where?

thanks

What about a relational table JOINS and its data? anything?

I have many relational tables and I want to retrieve all relational tables that belongs to the one I am pulling the information I tried many things to try to show the relational tables using the API but do not find any hook for it...

for instance show all clientes and clientes can have many addresses and groups...
I want to show the client with the addresses and group he/she belongs...

One clear example will be:
I have a post table that has comments (made by users) and the posts can have tags.

how can I join these tables for output with this API? is there any solution for this?

Appreciate any info
thanks

Doesn't work with new versions of data

composer require atk4/data
composer require atk4/api

will produce an error

  Problem 1
    - Root composer.json requires atk4/api ^0.3.0 -> satisfiable by atk4/api[0.3].
    - atk4/api 0.3 requires atk4/data ^2.0 -> found atk4/data[2.0.0, ..., 2.4.0] but it conflicts with your root composer.json require (^5.0).

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.