Closed jzogg closed 8 years ago
@jzogg What is your root requirement? To enable type: 'integter'
for strong-remoting declarations? (We only support type: 'number'
today).
FYI: LoopBack swagger spec generation allows integer
- https://github.com/strongloop/loopback-swagger/blob/master/lib/specgen/schema-builder.js#L13
After a discussion with Raymond & Ritchie, following is the proposal re. supporting integer
data type:
Enable type: integer
with a strict
flag such that:
strict: true
integer
-> send 400
(i.e. enforce strict integer
type)integer
-> send 500
strict: false
integer
-> truncate input to integer
(i.e 2.9
=> 2
)integer
-> truncate input to integer
@jzogg : Does that supports your use case. If not, could you please share your requirement.
cc/ @bajtos @ritch @raymondfeng If there is a consent for the above proposal, I'll update the PR#323 to reflect it.
IMO, we should implement only strict:true
behaviour right now (no flag involved) and wait until there is a clear need for strict:false
before implementing that other mode.
@jzogg : FYI: the architects agreed on @bajtos's above proposal to implement only strict:true behaviour right now (no flag involved) and it'll be reflected in the patch.
Patch is landed, hasn't been released to npmjs
yet. Will udpate when released (which would be ASAP)
Released in strong-remoting@2.29.0
.
IBM support sent me this way. I had created IBM service request 46011999000 because this is for GoDaddy and we have a paid subscription.
loopback version 2.18.1 strong-remoting version 2.19.0
converting parameter to target type includes explicit support for 'integer' in shared-method.js lines 390-443
loopback version 2.28.0 strong-remoting version 2.26.0
converting parameter to target type does not include support for 'integer' in shared-method.js lines 373-424
We have Swagger specs that have been using integer which is completely valid but a newer version of loopback we'd be forced to switch to number and manually handle checking for fractional values. I don't think that's appropriate.