Giter Site home page Giter Site logo

Issue with Padrino about sinja HOT 9 CLOSED

jnylen avatar jnylen commented on May 23, 2024
Issue with Padrino

from sinja.

Comments (9)

jnylen avatar jnylen commented on May 23, 2024

Got that error gone by forking padrino-core and replacing mustermann19 with mustermann.

But any of the resource :channel responds Sinja::NotAcceptableError

Also if I use Sinatra::Base instead of Padrino::Application it does the same.

from sinja.

mwpastore avatar mwpastore commented on May 23, 2024

Hi @jnylen:

Got that error gone by forking padrino-core and replacing mustermann19 with mustermann.

It looks like maybe Mustermann was forked to add support for Ruby 1.9, and this is the version Padrino is using, instead of the version of Mustermann that is used by Sinatra 2.0. Your fix may have gotten it to work for now, but there are likely other issues within Padrino if you use a different Mustermann. Does Padrino pass its test suite with your change?

I have an issue trying to load sinja with Padrino.

I cannot recommend using Sinja with Padrino at this time. Although Padrino is based on Sinatra and it should be fine, I have not tested it at all. I'm not familiar enough with what Padrino does to integrate with Sinatra, and how that might interfere with what Sinja does to integrate with Sinatra. Stick with vanilla Sinatra if you can.

But any of the resource :channel responds Sinja::NotAcceptableError

Are you following the {json:api} specification? It sounds like you need to send an Accept header with your requests. 😄

from sinja.

jnylen avatar jnylen commented on May 23, 2024

@mwpastore,
Padrino tests passes for everything above 2.2.0.

Send a specific Accept with vnd.api thing didn't help. Could you try a sample padrino app on your side if it fails there too?

from sinja.

mwpastore avatar mwpastore commented on May 23, 2024

I can't commit to supporting Sinja in Padrino at this time.

You sent Accept: application/vnd.api+json? What client library are you using? Can you try to get it working from the command-line with curl?

from sinja.

jnylen avatar jnylen commented on May 23, 2024

I tried with curl, and I get 404:
curl -H "Accept: application/vnd.api+json" http://localhost:2300/v3/channel (and with /v3/channels)

from sinja.

mwpastore avatar mwpastore commented on May 23, 2024

Okay? Where is your application mounted? Is this Padrino still or Sinatra::Base? How were you structuring your requests to get the 406 errors in the first place?

from sinja.

jnylen avatar jnylen commented on May 23, 2024

The app is mounted like:

Padrino.mount('Server::ApiV3', :app_file => Padrino.root('api_v3/app.rb')).to('/v3')

Ah, I got it working by using Sinatra::Base again.

Is it possible to show the API even though the user doesn't send Accept: application/vnd.api+json (or what its named) when they send Accept: */*? It won't show up in chrome. But will show up in curl.

from sinja.

jnylen avatar jnylen commented on May 23, 2024

Got it working.

Fast as hell so far. Good job.

from sinja.

mwpastore avatar mwpastore commented on May 23, 2024

Great! Glad to hear it!

from sinja.

Related Issues (19)

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.