File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 2121 "mdgriffith/elm-codegen" : " 5.2.0" ,
2222 "miniBill/elm-fast-dict" : " 1.2.4" ,
2323 "myrho/yaml" : " 1.0.0" ,
24+ "robinheghan/murmur3" : " 1.0.0" ,
2425 "turboMaCk/non-empty-list-alias" : " 1.4.0" ,
2526 "wolfadex/elm-ansi" : " 3.0.0" ,
2627 "wolfadex/elm-open-api" : " 2.0.0"
5556 "myrho/elm-parser-extras" : " 1.0.1" ,
5657 "noahzgordon/elm-color-extra" : " 1.0.2" ,
5758 "robinheghan/fnv1a" : " 1.0.0" ,
58- "robinheghan/murmur3" : " 1.0.0" ,
5959 "rtfeldman/elm-css" : " 18.0.0" ,
6060 "rtfeldman/elm-hex" : " 1.0.0" ,
6161 "rtfeldman/elm-iso8601-date-strings" : " 1.1.4" ,
Original file line number Diff line number Diff line change 1818 "json-tools/json-schema" : " 1.0.0 <= v < 2.0.0" ,
1919 "mdgriffith/elm-codegen" : " 5.2.0 <= v < 6.0.0" ,
2020 "miniBill/elm-fast-dict" : " 1.2.0 <= v < 2.0.0" ,
21+ "robinheghan/murmur3" : " 1.0.0 <= v < 2.0.0" ,
2122 "turboMaCk/non-empty-list-alias" : " 1.4.0 <= v < 2.0.0" ,
2223 "wolfadex/elm-open-api" : " 2.0.0 <= v < 3.0.0"
2324 },
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ import Json.Decode
3838import Json.Encode
3939import Json.Schema.Definitions
4040import Maybe.Extra
41+ import Murmur3
4142import OpenApi
4243import OpenApi.Common.Internal
4344import OpenApi.Components
@@ -510,12 +511,20 @@ oneOfType types =
510511 names : List Common . UnsafeName
511512 names =
512513 List . map . name sortedVariants
514+
515+ readableName : String
516+ readableName =
517+ names
518+ |> List . map fixOneOfName
519+ |> String . join " _Or_"
513520 in
514521 { type_ =
515522 Common . OneOf
516- ( names
517- |> List . map fixOneOfName
518- |> String . join " _Or_"
523+ ( if String . length readableName > 200 then
524+ " OneOf" ++ String . fromInt ( Murmur3 . hashString 1234 readableName)
525+
526+ else
527+ readableName
519528 )
520529 sortedVariants
521530 , documentation =
You can’t perform that action at this time.
0 commit comments