Open
Conversation
6d9ac03 to
603ee6c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
603ee6c to
f5e36e9
Compare
4462506 to
6848100
Compare
6848100 to
98fb23f
Compare
…chipping away at the problems later
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/NullableEnum/Api.elm branch/cli/generated/NullableEnum/Api.elm
0a1,55
> module NullableEnum.Api exposing (root, rootTask)
>
> {-|
>
>
> ## Operations
>
> @docs root, rootTask
>
> -}
>
> import Dict
> import Http
> import Json.Decode
> import NullableEnum.Json
> import NullableEnum.Types
> import OpenApi.Common
> import Task
>
>
> {-| Does stuff
> -}
> root config =
> Http.request
> { url = "/"
> , method = "GET"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> NullableEnum.Json.decodeNullableEnum
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> {-| Does stuff
> -}
> rootTask :
> {}
> -> Task.Task (OpenApi.Common.Error e String) NullableEnum.Types.NullableEnum
> rootTask config =
> Http.task
> { url = "/"
> , method = "GET"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> NullableEnum.Json.decodeNullableEnum
> , body = Http.emptyBody
> , timeout = Nothing
> }
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/OverridingGlobalSecurity/Api.elm branch/cli/generated/OverridingGlobalSecurity/Api.elm
0a1,210
> module OverridingGlobalSecurity.Api exposing
> ( getProtectedData, getProtectedDataTask, getUnprotectedData, getUnprotectedDataTask, patchUnprotectedData, patchUnprotectedDataTask
> , postUnprotectedData, postUnprotectedDataTask
> )
>
> {-|
>
>
> ## Operations
>
> @docs getProtectedData, getProtectedDataTask, getUnprotectedData, getUnprotectedDataTask, patchUnprotectedData, patchUnprotectedDataTask
> @docs postUnprotectedData, postUnprotectedDataTask
>
> -}
>
> import Dict
> import Http
> import Json.Decode
> import OpenApi.Common
> import OverridingGlobalSecurity.Json.Responses
> import OverridingGlobalSecurity.Types.Responses
> import Task
> import Url.Builder
>
>
> {-| Endpoint requiring token
>
> Get secret data. Auth required!
>
> -}
> getProtectedData :
> { authorization : { token : String }
> , toMsg :
> Result (OpenApi.Common.Error e String) OverridingGlobalSecurity.Types.Responses.Data
> -> msg
> }
> -> Cmd msg
> getProtectedData config =
> Http.request
> { url = Url.Builder.absolute [ "api", "protected" ] []
> , method = "GET"
> , headers =
> [ Http.header
> "Authorization"
> ("Token " ++ config.authorization.token)
> ]
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> {-| Endpoint requiring token
>
> Get secret data. Auth required!
>
> -}
> getProtectedDataTask :
> { authorization : { token : String } }
> -> Task.Task (OpenApi.Common.Error e String) OverridingGlobalSecurity.Types.Responses.Data
> getProtectedDataTask config =
> Http.task
> { url = Url.Builder.absolute [ "api", "protected" ] []
> , method = "GET"
> , headers =
> [ Http.header
> "Authorization"
> ("Token " ++ config.authorization.token)
> ]
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> , body = Http.emptyBody
> , timeout = Nothing
> }
>
>
> {-| Unprotected endpoint to get data
>
> Get some data. No auth required.
>
> -}
> getUnprotectedData config =
> Http.request
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "GET"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> {-| Unprotected endpoint to get data
>
> Get some data. No auth required.
>
> -}
> getUnprotectedDataTask :
> {}
> -> Task.Task (OpenApi.Common.Error e String) OverridingGlobalSecurity.Types.Responses.Data
> getUnprotectedDataTask config =
> Http.task
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "GET"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> , body = Http.emptyBody
> , timeout = Nothing
> }
>
>
> {-| Unprotected endpoint to store data (again)
>
> Store some data. No auth required.
>
> -}
> patchUnprotectedData config =
> Http.request
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "PATCH"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> {-| Unprotected endpoint to store data (again)
>
> Store some data. No auth required.
>
> -}
> patchUnprotectedDataTask :
> {}
> -> Task.Task (OpenApi.Common.Error e String) OverridingGlobalSecurity.Types.Responses.Data
> patchUnprotectedDataTask config =
> Http.task
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "PATCH"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> , body = Http.emptyBody
> , timeout = Nothing
> }
>
>
> {-| Unprotected endpoint to store data
>
> Store some data. No auth required.
>
> -}
> postUnprotectedData config =
> Http.request
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "POST"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> {-| Unprotected endpoint to store data
>
> Store some data. No auth required.
>
> -}
> postUnprotectedDataTask :
> {}
> -> Task.Task (OpenApi.Common.Error e String) OverridingGlobalSecurity.Types.Responses.Data
> postUnprotectedDataTask config =
> Http.task
> { url = Url.Builder.absolute [ "api", "unprotected" ] []
> , method = "POST"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> OverridingGlobalSecurity.Json.Responses.decodeData
> , body = Http.emptyBody
> , timeout = Nothing
> }
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/OverridingGlobalSecurity/Json/Responses.elm branch/cli/generated/OverridingGlobalSecurity/Json/Responses.elm
0a1,34
> module OverridingGlobalSecurity.Json.Responses exposing
> ( encodeData
> , decodeData
> )
>
> {-|
>
>
> ## Encoders
>
> @docs encodeData
>
>
> ## Decoders
>
> @docs decodeData
>
> -}
>
> import Json.Decode
> import Json.Encode
> import OverridingGlobalSecurity.Json
> import OverridingGlobalSecurity.Types
> import OverridingGlobalSecurity.Types.Responses
>
>
> encodeData : OverridingGlobalSecurity.Types.Responses.Data -> Json.Encode.Value
> encodeData =
> OverridingGlobalSecurity.Json.encodeData
>
>
> decodeData : Json.Decode.Decoder OverridingGlobalSecurity.Types.Responses.Data
> decodeData =
> OverridingGlobalSecurity.Json.decodeData
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/OverridingGlobalSecurity/Types/Responses.elm branch/cli/generated/OverridingGlobalSecurity/Types/Responses.elm
0a1,16
> module OverridingGlobalSecurity.Types.Responses exposing (Data)
>
> {-|
>
>
> ## Aliases
>
> @docs Data
>
> -}
>
> import OverridingGlobalSecurity.Types
>
>
> type alias Data =
> OverridingGlobalSecurity.Types.Data
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/RecursiveAllofRefs/Api.elm branch/cli/generated/RecursiveAllofRefs/Api.elm
0a1,52
> module RecursiveAllofRefs.Api exposing (getGrandChild, getGrandChildTask)
>
> {-|
>
>
> ## Operations
>
> @docs getGrandChild, getGrandChildTask
>
> -}
>
> import Dict
> import Http
> import Json.Decode
> import OpenApi.Common
> import RecursiveAllofRefs.Json
> import RecursiveAllofRefs.Types
> import Task
> import Url.Builder
>
>
> getGrandChild config =
> Http.request
> { url = Url.Builder.absolute [ "api", "grand-child" ] []
> , method = "GET"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> RecursiveAllofRefs.Json.decodeGrandChild
> config.toMsg
> , body = Http.emptyBody
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> getGrandChildTask :
> {}
> -> Task.Task (OpenApi.Common.Error e String) RecursiveAllofRefs.Types.GrandChild
> getGrandChildTask config =
> Http.task
> { url = Url.Builder.absolute [ "api", "grand-child" ] []
> , method = "GET"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> RecursiveAllofRefs.Json.decodeGrandChild
> , body = Http.emptyBody
> , timeout = Nothing
> }
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skipping ungenerable paths made sense when we had a lot of holes in our coverage, but I think it's time to switch to fail-by-default, while keeping the option to keep going on failed paths.
Eventually we probably want this option to go away, when we're confident we're covering most of the spec.
Same with the "generate
Debug.todo" one honestly. That one should probably go even before.