git.iko.soy/typeable/swagger2
on master help sign in
Change warning for inline* helpers to a more correct
commit658ad6cee167c2f6639013ad4631c6cfe4a71cf8 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSun 13 Dec 2015, 02:42 (11 years ago) parenta4fc118
1 file changed+6−3
src/Data/Swagger/Internal/Schema.hs+6−3
src/Data/Swagger/Internal/Schema.hs+6−3
@@ -170,7 +170,8 @@ declareSchemaRef proxy = do
170170-- /NOTE:/ if a referenced schema is not found in definitions the predicate is ignored
171171-- and schema stays referenced.
172172--
173−-- __WARNING:__ @'inlineSchemasWhen'@ will loop when inlining recursive schemas.
173+-- __WARNING:__ @'inlineSchemasWhen'@ will produce infinite schemas
174+-- when inlining recursive schemas.
174175inlineSchemasWhen :: Data s => (T.Text -> Bool) -> Definitions -> s -> s
175176inlineSchemasWhen p defs = template %~ deref
176177 where
@@ -186,14 +187,16 @@ inlineSchemasWhen p defs = template %~ deref
186187-- /NOTE:/ if a referenced schema is not found in definitions
187188-- it stays referenced even if it appears in the list of names.
188189--
189−-- __WARNING:__ @'inlineSchemas'@ will loop when inlining recursive schemas.
190+-- __WARNING:__ @'inlineSchemasWhen'@ will produce infinite schemas
191+-- when inlining recursive schemas.
190192inlineSchemas :: Data s => [T.Text] -> Definitions -> s -> s
191193inlineSchemas names = inlineSchemasWhen (`elem` names)
192194
193195-- | Inline all schema references for which the definition
194196-- can be found in @'Definitions'@.
195197--
196−-- __WARNING:__ @'inlineAllSchemas'@ will loop when inlining recursive schemas.
198+-- __WARNING:__ @'inlineSchemasWhen'@ will produce infinite schemas
199+-- when inlining recursive schemas.
197200inlineAllSchemas :: Data s => Definitions -> s -> s
198201inlineAllSchemas = inlineSchemasWhen (const True)
199202