Skip to content

Commit 7376fec

Browse files
committed
Fix elm-review warnings
1 parent 83bcd11 commit 7376fec

3 files changed

Lines changed: 1 addition & 47 deletions

File tree

‎review/suppressed/NoUnused.Exports.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"automatically created by": "elm-review suppress",
44
"learn more": "elm-review suppress --help",
55
"suppressions": [
6+
{ "count": 1, "filePath": "src/CliMonad.elm" },
67
{ "count": 1, "filePath": "src/OpenApi/Common/Internal.elm" }
78
]
89
}

‎src/Common.elm‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module Common exposing
99
, Package(..)
1010
, RefTo
1111
, RequestBody
12-
, Response
1312
, Schema
1413
, Type(..)
1514
, TypeName
@@ -22,7 +21,6 @@ module Common exposing
2221
, moduleToNamespace
2322
, parseRef
2423
, parseRequestBodyRef
25-
, parseResponseRef
2624
, parseSchemaRef
2725
, refTo
2826
, refToString
@@ -481,10 +479,6 @@ type RequestBody
481479
= TypeLevelRequestBody Never
482480

483481

484-
type Response
485-
= TypeLevelResponse Never
486-
487-
488482
type BasicType
489483
= Integer
490484
| Boolean
@@ -582,19 +576,6 @@ parseRequestBodyRef ref =
582576
)
583577

584578

585-
parseResponseRef : String -> Result String (RefTo Response)
586-
parseResponseRef ref =
587-
parseRef ref
588-
|> Result.andThen
589-
(\(RefTo component res) ->
590-
if component == Response then
591-
Ok (RefTo Response res)
592-
593-
else
594-
Err ("Expected a reference to a response, found a reference to " ++ ref)
595-
)
596-
597-
598579
unwrapUnsafe : UnsafeName -> String
599580
unwrapUnsafe (UnsafeName name) =
600581
name

‎src/OpenApi/Generate.elm‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ type ContentSchema
8686
| StringContent Mime
8787
| BytesContent Mime
8888
| Base64Content Mime
89-
| ReferenceContent (Common.RefTo Common.RequestBody)
9089

9190

9291
type alias AuthorizationInfo =
@@ -572,11 +571,6 @@ contentSchemaToBodyBuilder bodyContent =
572571
|> Gen.Base64.fromBytes
573572
|> Gen.Maybe.withDefault (Elm.string "")
574573
)
575-
576-
ReferenceContent _ ->
577-
CliMonad.map
578-
(\todo _ -> todo)
579-
(CliMonad.todo "toRequestFunctions: branch 'ReferenceContent _' not implemented")
580574
in
581575
perPackageMap toBody perPackageBindings
582576

@@ -656,9 +650,6 @@ contentSchemaToBodyParams contentSchema =
656650
CliMonad.succeed (Just Gen.Bytes.annotation_.bytes)
657651
|> CliMonad.withRequiredPackage "elm/bytes"
658652
|> CliMonad.withRequiredPackage Common.base64PackageName
659-
660-
ReferenceContent _ ->
661-
CliMonad.fail "toRequestFunctions: branch 'ReferenceContent _' not implemented"
662653
in
663654
annotation
664655
|> CliMonad.map
@@ -2600,9 +2591,6 @@ operationToTypesExpectAndResolver effectTypes method pathUrl operation =
26002591
, toMsg = toMsg
26012592
}
26022593
|> CliMonad.succeed
2603-
2604-
ReferenceContent _ ->
2605-
CliMonad.fail "operationToTypesExpectAndResolver: branch 'ReferenceContent _' not implemented"
26062594
)
26072595
(OpenApi.Response.content response
26082596
|> contentToContentSchema
@@ -2680,9 +2668,6 @@ errorResponsesToType functionName errorResponses =
26802668

26812669
Base64Content _ ->
26822670
CliMonad.succeed Elm.Annotation.string
2683-
2684-
ReferenceContent ref ->
2685-
CliMonad.refToAnnotation ref
26862671
)
26872672

26882673
Nothing ->
@@ -2777,9 +2762,6 @@ errorResponsesToErrorDecoders functionName errorResponses =
27772762

27782763
EmptyContent ->
27792764
CliMonad.succeed (Gen.Json.Decode.succeed Elm.unit)
2780-
2781-
ReferenceContent _ ->
2782-
CliMonad.todo "$ref errors are not supported yet"
27832765
)
27842766

27852767
Nothing ->
@@ -2850,16 +2832,6 @@ responseToSchema response =
28502832
|> CliMonad.map OpenApi.Schema.get
28512833

28522834

2853-
requestBodyToSchema : OpenApi.RequestBody.RequestBody -> CliMonad Json.Schema.Definitions.Schema
2854-
requestBodyToSchema requestBody =
2855-
CliMonad.succeed requestBody
2856-
|> CliMonad.stepOrFail "The request does not have a json content"
2857-
(OpenApi.RequestBody.content >> searchForJsonMediaType)
2858-
|> CliMonad.stepOrFail "The request body's json content option doesn't have a schema"
2859-
OpenApi.MediaType.schema
2860-
|> CliMonad.map OpenApi.Schema.get
2861-
2862-
28632835
makeNamespaceValid : String -> String
28642836
makeNamespaceValid str =
28652837
String.map

0 commit comments

Comments
 (0)