@@ -105,7 +105,7 @@ rename name (NamedSchema _ schema) = NamedSchema name schema
105105-- declareNamedSchema _ = do
106106-- doubleSchema <- declareSchemaRef (Proxy :: Proxy Double)
107107-- return $ NamedSchema (Just \"Coord\") $ mempty
108−-- & type_ ?~ SwaggerObject
108+-- & type_ ?~ OpenApiObject
109109-- & properties .~
110110-- [ (\"x\", doubleSchema)
111111-- , (\"y\", doubleSchema)
@@ -312,12 +312,12 @@ sketchSchema = sketch . toJSON
312312 sketch js@(Bool _) = go js
313313 sketch js = go js & example ?~ js
314314
315− go Null = mempty & type_ ?~ SwaggerNull
316− go (Bool _) = mempty & type_ ?~ SwaggerBoolean
317− go (String _) = mempty & type_ ?~ SwaggerString
318− go (Number _) = mempty & type_ ?~ SwaggerNumber
315+ go Null = mempty & type_ ?~ OpenApiNull
316+ go (Bool _) = mempty & type_ ?~ OpenApiBoolean
317+ go (String _) = mempty & type_ ?~ OpenApiString
318+ go (Number _) = mempty & type_ ?~ OpenApiNumber
319319 go (Array xs) = mempty
320− & type_ ?~ SwaggerArray
320+ & type_ ?~ OpenApiArray
321321 & items ?~ case ischema of
322322 Just s -> SwaggerItemsObject (Inline s)
323323 _ -> SwaggerItemsArray (map Inline ys)
@@ -329,7 +329,7 @@ sketchSchema = sketch . toJSON
329329 (z:_) | allSame -> Just z
330330 _ -> Nothing
331331 go (Object o) = mempty
332− & type_ ?~ SwaggerObject
332+ & type_ ?~ OpenApiObject
333333 & required .~ HashMap.keys o
334334 & properties .~ fmap (Inline . go) (InsOrdHashMap.fromHashMap o)
335335
@@ -352,24 +352,24 @@ sketchSchema = sketch . toJSON
352352sketchStrictSchema :: ToJSON a => a -> Schema
353353sketchStrictSchema = go . toJSON
354354 where
355− go Null = mempty & type_ ?~ SwaggerNull
355+ go Null = mempty & type_ ?~ OpenApiNull
356356 go js@(Bool _) = mempty
357− & type_ ?~ SwaggerBoolean
357+ & type_ ?~ OpenApiBoolean
358358 & enum_ ?~ [js]
359359 go js@(String s) = mempty
360− & type_ ?~ SwaggerString
360+ & type_ ?~ OpenApiString
361361 & maxLength ?~ fromIntegral (T.length s)
362362 & minLength ?~ fromIntegral (T.length s)
363363 & pattern ?~ s
364364 & enum_ ?~ [js]
365365 go js@(Number n) = mempty
366− & type_ ?~ SwaggerNumber
366+ & type_ ?~ OpenApiNumber
367367 & maximum_ ?~ n
368368 & minimum_ ?~ n
369369 & multipleOf ?~ n
370370 & enum_ ?~ [js]
371371 go js@(Array xs) = mempty
372− & type_ ?~ SwaggerArray
372+ & type_ ?~ OpenApiArray
373373 & maxItems ?~ fromIntegral sz
374374 & minItems ?~ fromIntegral sz
375375 & items ?~ SwaggerItemsArray (map (Inline . go) (V.toList xs))
@@ -379,7 +379,7 @@ sketchStrictSchema = go . toJSON
379379 sz = length xs
380380 allUnique = sz == HashSet.size (HashSet.fromList (V.toList xs))
381381 go js@(Object o) = mempty
382− & type_ ?~ SwaggerObject
382+ & type_ ?~ OpenApiObject
383383 & required .~ names
384384 & properties .~ fmap (Inline . go) (InsOrdHashMap.fromHashMap o)
385385 & maxProperties ?~ fromIntegral (length names)
@@ -395,7 +395,7 @@ instance {-# OVERLAPPABLE #-} ToSchema a => ToSchema [a] where
395395 declareNamedSchema _ = do
396396 ref <- declareSchemaRef (Proxy :: Proxy a)
397397 return $ unnamed $ mempty
398− & type_ ?~ SwaggerArray
398+ & type_ ?~ OpenApiArray
399399 & items ?~ SwaggerItemsObject ref
400400
401401instance {-# OVERLAPPING #-} ToSchema String where declareNamedSchema = plain . paramSchemaToSchema
@@ -447,7 +447,7 @@ instance (ToSchema a, ToSchema b, ToSchema c, ToSchema d, ToSchema e, ToSchema f
447447
448448timeSchema :: T.Text -> Schema
449449timeSchema fmt = mempty
450− & type_ ?~ SwaggerString
450+ & type_ ?~ OpenApiString
451451 & format ?~ fmt
452452
453453-- | Format @"date"@ corresponds to @yyyy-mm-dd@ format.
@@ -505,7 +505,7 @@ instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (Map k v) where
505505 declareObjectMapSchema = do
506506 schema <- declareSchemaRef (Proxy :: Proxy v)
507507 return $ unnamed $ mempty
508− & type_ ?~ SwaggerObject
508+ & type_ ?~ OpenApiObject
509509 & additionalProperties ?~ AdditionalPropertiesSchema schema
510510
511511instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (HashMap k v) where
@@ -513,7 +513,7 @@ instance (ToJSONKey k, ToSchema k, ToSchema v) => ToSchema (HashMap k v) where
513513
514514instance {-# OVERLAPPING #-} ToSchema Object where
515515 declareNamedSchema _ = pure $ NamedSchema (Just "Object") $ mempty
516− & type_ ?~ SwaggerObject
516+ & type_ ?~ OpenApiObject
517517 & description ?~ "Arbitrary JSON object."
518518 & additionalProperties ?~ AdditionalPropertiesAllowed True
519519
@@ -554,7 +554,7 @@ instance ToSchema a => ToSchema (Identity a) where declareNamedSchema _ = declar
554554-- {"maximum":32767,"minimum":-32768,"type":"integer"}
555555toSchemaBoundedIntegral :: forall a. (Bounded a, Integral a) => Proxy a -> Schema
556556toSchemaBoundedIntegral _ = mempty
557− & type_ ?~ SwaggerInteger
557+ & type_ ?~ OpenApiInteger
558558 & minimum_ ?~ fromInteger (toInteger (minBound :: a))
559559 & maximum_ ?~ fromInteger (toInteger (maxBound :: a))
560560
@@ -600,7 +600,7 @@ declareSchemaBoundedEnumKeyMapping _ = case toJSONKey :: ToJSONKeyFunction key o
600600 let allKeys = [minBound..maxBound :: key]
601601 mkPair k = (keyToText k, valueRef)
602602 return $ mempty
603− & type_ ?~ SwaggerObject
603+ & type_ ?~ OpenApiObject
604604 & properties .~ InsOrdHashMap.fromList (map mkPair allKeys)
605605
606606-- | A 'Schema' for a mapping with 'Bounded' 'Enum' keys.
@@ -659,7 +659,7 @@ paramSchemaToSchema = toParamSchema
659659
660660nullarySchema :: Schema
661661nullarySchema = mempty
662− & type_ ?~ SwaggerArray
662+ & type_ ?~ OpenApiArray
663663 & items ?~ SwaggerItemsArray []
664664
665665gtoNamedSchema :: GToSchema f => SchemaOptions -> Proxy f -> NamedSchema
@@ -730,12 +730,12 @@ withFieldSchema opts _ isRequiredField schema = do
730730 return $
731731 if T.null fname
732732 then schema
733− & type_ ?~ SwaggerArray
733+ & type_ ?~ OpenApiArray
734734 & items %~ appendItem ref
735735 & maxItems %~ Just . maybe 1 (+1) -- increment maxItems
736736 & minItems %~ Just . maybe 1 (+1) -- increment minItems
737737 else schema
738− & type_ ?~ SwaggerObject
738+ & type_ ?~ OpenApiObject
739739 & properties . at fname ?~ ref
740740 & if isRequiredField
741741 then required %~ (++ [fname])
@@ -770,14 +770,14 @@ gdeclareNamedSumSchema opts proxy _
770770 | otherwise = do
771771 (schemas, _) <- runWriterT declareSumSchema
772772 return $ unnamed $ mempty
773− & type_ ?~ SwaggerObject
773+ & type_ ?~ OpenApiObject
774774 & oneOf ?~ (snd <$> schemas)
775775 where
776776 declareSumSchema = gsumToSchema opts proxy
777777 (sumSchemas, All allNullary) = undeclare (runWriterT declareSumSchema)
778778
779779 toStringTag schemas = mempty
780− & type_ ?~ SwaggerString
780+ & type_ ?~ OpenApiString
781781 & enum_ ?~ map (String . fst) sumSchemas
782782
783783type AllNullary = All
@@ -799,15 +799,15 @@ gsumConToSchemaWith ref opts _ = (tag, schema)
799799 case ref of
800800 -- If subschema is an object and constructor is a record, we add tag directly
801801 -- to the record, as Aeson does it.
802− Just (Inline sub) | sub ^. type_ == Just SwaggerObject && isRecord -> Inline $ sub
802+ Just (Inline sub) | sub ^. type_ == Just OpenApiObject && isRecord -> Inline $ sub
803803 & required <>~ [T.pack tagField]
804− & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ SwaggerString & enum_ ?~ [String tag])
804+ & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ OpenApiString & enum_ ?~ [String tag])
805805
806806 -- If it is not a record, we need to put subschema into "contents" field.
807807 _ | not isRecord -> Inline $ mempty
808− & type_ ?~ SwaggerObject
808+ & type_ ?~ OpenApiObject
809809 & required .~ [T.pack tagField]
810− & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ SwaggerString & enum_ ?~ [String tag])
810+ & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ OpenApiString & enum_ ?~ [String tag])
811811 -- If constructor is nullary, there is no content.
812812 & case ref of
813813 Just r -> (properties . at (T.pack contentsField) ?~ r) . (required <>~ [T.pack contentsField])
@@ -815,17 +815,17 @@ gsumConToSchemaWith ref opts _ = (tag, schema)
815815
816816 -- In the remaining cases we combine "tag" object and "contents" object using allOf.
817817 _ -> Inline $ mempty
818− & type_ ?~ SwaggerObject
818+ & type_ ?~ OpenApiObject
819819 & allOf ?~ [Inline $ mempty
820− & type_ ?~ SwaggerObject
820+ & type_ ?~ OpenApiObject
821821 & required .~ (T.pack tagField : if isRecord then [] else [T.pack contentsField])
822− & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ SwaggerString & enum_ ?~ [String tag])]
822+ & properties . at (T.pack tagField) ?~ (Inline $ mempty & type_ ?~ OpenApiString & enum_ ?~ [String tag])]
823823 & if isRecord
824824 then allOf . _Just <>~ [refOrNullary]
825− else allOf . _Just <>~ [Inline $ mempty & type_ ?~ SwaggerObject & properties . at (T.pack contentsField) ?~ refOrNullary]
825+ else allOf . _Just <>~ [Inline $ mempty & type_ ?~ OpenApiObject & properties . at (T.pack contentsField) ?~ refOrNullary]
826826 UntaggedValue -> refOrEnum -- Aeson encodes nullary constructors as strings in this case.
827827 ObjectWithSingleField -> Inline $ mempty
828− & type_ ?~ SwaggerObject
828+ & type_ ?~ OpenApiObject
829829 & required .~ [tag]
830830 & properties . at tag ?~ refOrNullary
831831 TwoElemArray -> error "unrepresentable in OpenAPI 3"
@@ -833,7 +833,7 @@ gsumConToSchemaWith ref opts _ = (tag, schema)
833833 tag = T.pack (constructorTagModifier opts (conName (Proxy3 :: Proxy3 c f p)))
834834 isRecord = conIsRecord (Proxy3 :: Proxy3 c f p)
835835 refOrNullary = fromMaybe (Inline nullarySchema) ref
836− refOrEnum = fromMaybe (Inline $ mempty & type_ ?~ SwaggerString & enum_ ?~ [String tag]) ref
836+ refOrEnum = fromMaybe (Inline $ mempty & type_ ?~ OpenApiString & enum_ ?~ [String tag]) ref
837837
838838gsumConToSchema :: (GToSchema (C1 c f), Constructor c) =>
839839 SchemaOptions -> Proxy (C1 c f) -> Declare (Definitions Schema) [(T.Text, Referenced Schema)]