Giter Site home page Giter Site logo

scarygami / dart_endpoints Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 3.0 109 KB

Implementation of Google Cloud Endpoints in Dart.

Home Page: https://dart-endpoints.appspot.com/

License: BSD 3-Clause "New" or "Revised" License

Dart 97.67% Shell 2.33%

dart_endpoints's People

Contributors

eanlombardo avatar scarygami avatar wibling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dart_endpoints's Issues

Cannot define an API with no arguments

I'm playing with appengine and endpoints. Trying to design the dumbest API. Without local logging and error reporting when calling addApi, it was hard to know that an API was badly defined (I ended up creating a unittest for validating my APIs calling new ApiConfig(new MyApi());

So my useless API was

class Time {
  @ApiProperty(description: 'Current time')
  DateTime now;

  Time([this.now]);
}

@ApiClass(
    name: 'time',
    version: 'v1',
    description: 'Time API'
)
class TimeEndPoint {

  @ApiMethod(
      path: 'time',
      name: 'time.get',
      method: 'GET',
      description: 'Get the current time'
  )
  Future<Time> get(VoidMessage _) async {
    return new Time(new DateTime.now());
  }
}

To note that I had to use a dummy "VoidMessage _" param for my single API. Is this a requirement for appengine or is it something that your validation is enforcing too much?

requestFields / responseFields in @ApiMethod

The idea is to allow reusing models but limiting the writable/returned fields in methods to a certain subset of the available fields.

Example

Currently:

class Score {
  int user;
  int score;
  DateTime timestamp;
}

class ScoreSubmission {
  int score;
}

@ApiMethod(...)
Score submit(ScoreSubmission request, ApiUser user) {
  Score score = new Score();
  score.user = user.id;
  score.score = request.score;
  score.timestamp = new DateTime.now();
  // insert score
  return score;
}

Planned:

class Score {
  int user;
  int score;
  DateTime timestamp;
}

@ApiMethod(...
  requestFields: const ['score']
)
Score submit(Score score, ApiUser user) {
  score.user = user.id;
  score.timestamp = new DateTime.now();
  // insert score
  return score;
}

ListResponse and ListRequest wrappers

ListResponse<MyMessage> list(ListRequest<MyMessage> request) {
  ...
}

Should include limit, offset, order parameters and allow filtering by elements of MyMessage.

Best to be used in combination with datastore models.

TicTacToe api not displayed in the explorer?

Hi and thank you so much for porting endpoints to dart. <3

I m trying to port my python code to dart, and i m getting issues using the TicTacToe demo

I pasted the whole TicTacToe project, and just replaced the client id by mine, but it seems to be not enough for the api explorer.

First i m getting a red ribbon about tls but i think it's normal and the workaround is pretty easy.

But "loading" hangs indefinitely... It just print a Http 500 (internal server error) and a "Uncaught java.lang.NullPointerException" 20 secs later.

Is this related to this, it seem to be fixed, but i cant reach http://localhost:8080/_ah/health => 503 - This request has timed out.

Thank you again! :)

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.