Skip to content

Commit

Permalink
Make tests succeed again
Browse files Browse the repository at this point in the history
  • Loading branch information
dfithian committed May 16, 2024
1 parent c2140cf commit af76a39
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openapi3-code-generator/src/OpenAPI/Generate/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ defineModels moduleName spec operationDependencies =
whiteListedSchemas <- OAM.getSetting OAO.settingWhiteListedSchemas
outputAllSchemas <- OAM.getSetting OAO.settingOutputAllSchemas
let dependencies = Set.union operationDependencies $ Set.fromList $ fmap transformToModuleName whiteListedSchemas
pure $ Dep.getModelModulesFromModelsWithDependencies moduleName dependencies models outputAllSchemas
pure $ Dep.getModelModulesFromModelsWithDependencies moduleName dependencies outputAllSchemas models

-- | Defines all supported security schemes from the 'OAT.OpenApiSpecification'.
defineSecuritySchemes :: String -> OAT.OpenApiSpecification -> OAM.Generator (Q Doc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ typesModule = "Types"

-- | Analyzes the dependencies of the provided models and splits them into modules.
-- All models which would form an own module but only consist of a type alias are put in a module named by 'Doc.typeAliasModule'.
getModelModulesFromModelsWithDependencies :: String -> Models -> [ModelWithDependencies] -> Bool -> Q [ModuleDefinition]
getModelModulesFromModelsWithDependencies mainModuleName operationAndWhiteListDependencies models outputAllSchemas = do
getModelModulesFromModelsWithDependencies :: String -> Models -> Bool -> [ModelWithDependencies] -> Q [ModuleDefinition]
getModelModulesFromModelsWithDependencies mainModuleName operationAndWhiteListDependencies outputAllSchemas models = do
let modelsToGenerate =
if outputAllSchemas
then models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Test.Hspec
spec :: Spec
spec =
describe "getModelModulesFromModelsWithDependencies" $ do
let sut = getModelModulesFromModelsWithDependencies "OpenAPI" (Set.fromList ["A", "B", "C", "D", "E", "F", "G"])
let sut = getModelModulesFromModelsWithDependencies "OpenAPI" (Set.fromList ["A", "B", "C", "D", "E", "F", "G"]) False
t = pure . text
it "should split string into pieces" $ do
result <-
Expand Down

0 comments on commit af76a39

Please sign in to comment.