diff --git a/changelog.d/4-docs/feature-schema-fix b/changelog.d/4-docs/feature-schema-fix new file mode 100644 index 0000000000..d4c3d44001 --- /dev/null +++ b/changelog.d/4-docs/feature-schema-fix @@ -0,0 +1 @@ +Feature configs should have different swagger schema names diff --git a/libs/wire-api/src/Wire/API/Team/Feature.hs b/libs/wire-api/src/Wire/API/Team/Feature.hs index 2c050ed448..092f11e823 100644 --- a/libs/wire-api/src/Wire/API/Team/Feature.hs +++ b/libs/wire-api/src/Wire/API/Team/Feature.hs @@ -473,10 +473,13 @@ modelTeamFeatureStatusWithConfig name cfgModel = Doc.defineModel (cs $ show name instance ToSchema cfg => ToSchema (TeamFeatureStatusWithConfig cfg) where schema = - object "TeamFeatureStatusWithConfig" $ + object name $ TeamFeatureStatusWithConfig <$> tfwcStatus .= field "status" schema - <*> tfwcConfig .= field "config" schema + <*> tfwcConfig .= field "config" inner + where + inner = schema @cfg + name = "TeamFeatureStatusWithConfig." <> fromMaybe "" (getName (schemaDoc inner)) data TeamFeatureStatusWithConfigAndLockStatus (cfg :: *) = TeamFeatureStatusWithConfigAndLockStatus { tfwcapsStatus :: TeamFeatureStatusValue, @@ -498,11 +501,14 @@ modelTeamFeatureStatusWithConfigAndLockStatus name cfgModel = Doc.defineModel (c instance ToSchema cfg => ToSchema (TeamFeatureStatusWithConfigAndLockStatus cfg) where schema = - object "TeamFeatureStatusWithConfigAndLockStatus" $ + object name $ TeamFeatureStatusWithConfigAndLockStatus <$> tfwcapsStatus .= field "status" schema - <*> tfwcapsConfig .= field "config" schema + <*> tfwcapsConfig .= field "config" inner <*> tfwcapsLockStatus .= field "lockStatus" schema + where + inner = schema @cfg + name = "TeamFeatureStatusWithConfigAndLockStatus." <> fromMaybe "" (getName (schemaDoc inner)) ---------------------------------------------------------------------- -- TeamFeatureClassifiedDomainsConfig