Closed zhulik closed 8 years ago
It's defaults: as in readme:
Feel free to edit |schemas| according to json-schema standard, |they| can be very strict and flexible if you wish
there are keys additionalProperties
and required
in schema which should allow to tune adding and removing fields
the choice not to mark everything under required
is still questionable and done when trying to share same schema (without using suffixes) across everything: I didn't want to setup database before every single spec-request to get full-futured api-result, so the amount of red results when lurking bunch of specs was frustrating
later I tend to lurk only the most valuable request-response pair and use suffixes, but it's also far from ideal :)
try to use it more and probably come up with ideas how to improve it :)
@razum2um, thanks! So i need to change yml files by hands? Maybe adding some configuration flag for specs is good idea? Something like this for rspec
it 'list users', lurker: { required: :all } do
get '/api/users'
end
So i need to change yml files by hand
the more you invest into json-schema the more payback ;)
lurker: { required: :all }
maybe :) one thing to think about: this info is needed only when you intend to re/write schemas automatically, there was an idea of LURKER_UPGRADE
flag (back to https://github.com/square/fdoc design), so maybe it should be env variable + you run only needed specs (rspec is cool at this)
@Strech @sponomarev what do you think?
required: :all
is inappropriate, because we can't choose which properties are required, and which are not. YML scheme is enough here. But any upgrade option could be cool.
@sponomarev :all is just an example, you can use [:array, :of, :fields], but, i supporse, for most cases, validation of all fields is preffered
@zhulik too much info about format in specs, which is just easy way to generate initial yml scheme imo
@zhulik [:array, :of, :fields]
when handling nesting we could end up with hiccup like style duplicating schemas in spec & yml :)
@sponomarev, you right, too much info here is not good. But, when user need to generate schemas for 20-30 endpoinds with all fields required he must update every yml file.Too many time for it is not good too.
And this case not my=), just hypotetical
@razum2um, you right too, nesting will be ugly there
Hi, it's me again=) lurker is works for me, but i note, that when i remove some fields from my api lurker specs stay green. But, when i add some new field - lurker tests is red. Is it valid behavior? How to check removed fields?