Questions tagged [restler]

A micro framework that can expose any PHP class and its methods as Pragmatic and/or RESTful API.

Restler is a simple multi-format Web API Server written in PHP. It is open sourced under LGPL license.

258 questions
1
vote
1 answer

Version Restler without copying entire previous API version

I'm using Restler 3.0.0-RC6 and I'm confused on versioning. I have a v1 version (in a namespace) and now I need to make a breaking API change, so I want to create a v2 dir/namespace. However, I only need a couple of the API methods to change. How…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
3 answers

How do I accept arbitrary query parameters in a Restler GET request?

I have a basic CRUD endpoint, and I want to be able to search by arbitrary fields in my database. Is there a way to allow this without specifying every possible filter in the method signature?
Jesse Weigert
  • 4,714
  • 5
  • 28
  • 37
1
vote
1 answer

Mark restler method param as optional in swagger documentation

I'm using the Restler framework to write my API, and it uses swagger to document things. When I define my method I'm having two issues with the resulting documentation. One is that the description of the parameters is not being displayed in…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
2 answers

Make JSON the default format in Resetler?

I'm going through the tutorial examples of Restler here: http://restler3.luracast.com/examples/_003_multiformat/readme.html While it states that: First format specified in Restler::setSupportedFormats is used as the default format when client…
datasn.io
  • 12,564
  • 28
  • 113
  • 154
1
vote
1 answer

Install Restler on Windows / Xampp

i'm trying to run restler on windows, in combination with Xampp. so i finnaly finished to unzip the files with composer, my htdocs directory looks like this, where the folder API is my restler directory: c:\xampp\htdocs\api\ * here are the restler…
Frank
  • 13
  • 4
1
vote
1 answer

have Restler method return a Content-Disposition header

In one of my get methods is it possible to specify a specific Content-Type and Content-Disposition? After getting my data back I'm doing this: return Scope::get('CsvFormat')->encode($data); and so the data returned is in a CSV format. Now I want…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
1 answer

Luracast Restler Multiple Authentication Classes Not Allowing Access

I have two authentication classes defined. API Keys (APIKeyAuth) OAUTH2 (OAUTH2Server) In my index.php I have the following defined $r = new Restler(); $r->addAuthenticationClass('APIKeyAuth'); $r->addAuthenticationClass('OAUTH2Server'); I…
Madmartigan
  • 260
  • 3
  • 11
1
vote
0 answers

Restler OAuth2 server

I have server login to my site. I use for API Restler 3 with OAuth2. Server.php:
Fanda36
  • 307
  • 1
  • 4
  • 10
1
vote
1 answer

Using Restler3, how to log requests/responses

Is there currently any means of capturing an incoming request and response, and logging that? I see that there are 'preCall' and 'postCall' methods, however, some of my API methods are not strictly named by HTTP verbs. For example, in my 'Players'…
Brett
  • 149
  • 13
1
vote
2 answers

Hide Restler method from swagger-ui

Using Restler 3.0.0-RC6, which internally packages swagger-ui, I have an API method defined like so:
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
1 answer

Restler custom URL routing not working

In my REST API I have Work associated with an Order, so using Restler (3.0.0-RC6) I created this method: class Orders { /** * Get completed work for order * * @param int $id The SQL identifier of the order * * @return…
Gargoyle
  • 9,590
  • 16
  • 80
  • 145
1
vote
1 answer

Composer - Mapping the src directory to the document root with the vendor folder outside

I have the following folder structure. src/ |- index.php test/ vendor/ composer.json composer.lock When i want to deploy my code, I realize that i have to map the src/ directory to document root since it contains the index.php file (which btw…
Abbas Gadhia
  • 14,532
  • 10
  • 61
  • 73
1
vote
1 answer

405 Method not allowed using Restler

I have a problem with Restler: I'm creating my own API to access my data from differente website. When I try to send a POST request to my API, it says: { error: { code: 405 message: "Method Not Allowed" } debug: { …
1
vote
1 answer

Restler Php : Vendor MIME Issue

I am trying to figure out the API versioning using Vendor MIME in Restler 3.0. Now the issue which I am facing is that I am not able figure out how to explicitly use the versions. I used the REST Console at my local MAC machine. I provided Accept…
turtle
  • 1,619
  • 1
  • 14
  • 30
1
vote
1 answer

Package version support using git tags

I'm the author of Restler framework, now trying to use properly named tags for package versioning. I'm using the following composer.json and named my tags as advised in https://getcomposer.org/doc/02-libraries.md#tags which you can see at…
Arul Kumaran
  • 983
  • 7
  • 23