Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 20 15:51
    ftsanjuan commented #689
  • May 20 15:31
    mathieujobin labeled #475
  • May 20 15:31
    mathieujobin commented #475
  • May 20 15:29
    mathieujobin labeled #759
  • May 20 15:29
    mathieujobin labeled #691
  • May 20 15:28
    mathieujobin closed #745
  • May 20 15:19
    mathieujobin commented #660
  • May 20 15:19
    mathieujobin closed #660
  • May 20 15:19
    mathieujobin closed #559
  • May 20 15:19
    mathieujobin commented #559
  • May 20 15:16

    mathieujobin on master

    fix: enable swagger generator t… Merge branch 'master' into fix/… Merge pull request #689 from ft… (compare)

  • May 20 15:16
    mathieujobin closed #689
  • May 20 15:15
    mathieujobin commented #719
  • May 20 15:15
    mathieujobin commented #745
  • May 20 15:14
    mathieujobin synchronize #689
  • May 20 15:12
    mathieujobin labeled #689
  • May 20 15:11
    mathieujobin labeled #719
  • May 20 15:10
    mathieujobin commented #719
  • May 20 15:09
    mathieujobin commented #745
  • May 20 11:24

    mathieujobin on master

    fix: Controller resource set be… Merge pull request #744 from Dr… (compare)

Alessio Caiazza
@nolith
hi guys. Is it possible to specify which test to use for generating examples with mintest ?
David Muñoz
@damuz91
Is this still alive?
Jacob Burenstam
@buren
@damuz91 well it depends I guess ;)
David Muñoz
@damuz91
@buren lol thanks for answering, i am just trying to find out if Apipie is reliable for my enterprise RoR solution
i love apipie, but i am wondering how alive is the community around
also i am looking to extend a functionality
Any advice?
Jacob Burenstam
@buren
hm.. well I guess thats a kinda valid question ;) I can say that indeed the repo is very active at this point, though I found it stable enough to use for a large-ish project
@damuz91 I’d say it depends on what you need
(I’m for example not using the built in validator beacause it could’t be customized enough to match my needs)
David Muñoz
@damuz91
This message was deleted
This message was deleted
Jacob Burenstam
@buren

also i am looking to extend a functionality

what kind of functionality do you need? @damuz91

David Muñoz
@damuz91

@buren Nice thanks. That customized validation sounds interesting, going to look for it, any advice.

I've noticed that in production an error returns a JSON that says that something has gone wrong, but in development it describes the parameter that i am missing. I'd like the response to be a JSON describing the missing attributes

Jacob Burenstam
@buren

Ok, that was basically what I needed too, though I was also conforming to jsonapi.org so I had to have the response in a certain way.

To me it seemed clear that it would be best to “own” as much of the validation logic as possible.

Are all of the fields required in order to successfully save your model object? (ActiveRecordor something else..)

If you can/should add those validations directly on the model and then you can return those error in whatever format you want

for ActiveRecord it could look something like this:

activerecord_model_instance.errors.messages.flat_map do |attribute, errors|
  errors.map do |error_message|
    {
      attribute: attribute,
      message: error_message
    }
  end
end
David Muñoz
@damuz91
Oh i see what you mean, we should leave the validation to the model and not to the ApiPie acting as a middleware that intercepts the request on the action and before it executes, that's clever, but i am wondering if there is any extension to make in order to leave this validation layer on the Apipie (I know it is not good looking to leave the validation there rather than in the model, but i am curious)
Jacob Burenstam
@buren

@damuz91 hm.. well this being Ruby you can basically do whatever you want, its just a matter of how “risky”/“reckless” one can be ;) I haven’t used that parts, so can’t say that I’m particular familiar with it either but here is the code:

Validation code:
https://github.com/Apipie/apipie-rails/blob/296c097f9acb951149d3a67db69b84eb216bdd7e/lib/apipie/dsl_definition.rb#L219-L254

Error classes:
https://github.com/Apipie/apipie-rails/blob/296c097f9acb951149d3a67db69b84eb216bdd7e/lib/apipie/errors.rb

David Muñoz
@damuz91
@buren Amazing, going to take a look at this
Thanks dude!
Jacob Burenstam
@buren
@damuz91 no worries happy to help :smile:
Sean Handley
@seanhandley
Has anyone successfully added Apipie docs into a Rails engine?
I've converted an existing Rails app into a Rails engine (and the controllers are working fine)
but the /docs path is raising uninitialized constant MyEngine::Apipie
Sean Handley
@seanhandley
Details: Apipie/apipie-rails#516
Jacob Burenstam
@buren
@seanhandley in the Rails engine have you defined apipie-rails as a dependency?
Sean Handley
@seanhandley
Yes @buren
I was able to get it working by taking this approach: Apipie/apipie-rails#127
i.e. defining the apipie-rails dependency in the host application and placing apipie into the routes.rb of that application.
But it's far from ideal because my overrides now need to be placed in the host application's codebase i.e. app/views/layouts/apipie/apipie.html.erb
I'd be much happier if I could get all the apipie specific stuff into the engine codebase then the host application just needs to require the gem and mount it within its routes.
Manuel
@WtfJoke
Is it possible to have the example(s) in a separate file somehow? We have quite big responses and providing a few examples makes the source file huge.
Manuel Tancoigne
@mtancoigne
Hello !
Joni Niemi
@muvox
Quick question! I currently have " Array || Hash " as my endpoint validator, but my docs say only "Array of any type". According to my tests both array and hash work. Is there a way to 'override' what comes under the params description in the docs?