SchlenkR/FsHttp

SchlenkR.FsHttp => FsHttp, error after migrating (FS0708)

Closed this issue · 7 comments

I wanted to migrate from SchlenkR.FsHttp to FsHttp and after restoring I get this error message at every operation, see:
image

Is it possible to post the code here? This usually happens when custom operation names changed. There were a lot of breaking changes. All Config operations are now prefixed with „config_“ for example.

From the screenshot, it looks like the Header operation is used. That was changed to header. I guess that's the reason it can't be resolved.

Should be:

http {
    DELETE $"..."
    header "Access-Token" "..."
}

There are conventions for naming custom operations for the builder methods here:

#48

There was a section in the documentation here:


## Naming Conventions

*Names for naming conventions according to: https://en.wikipedia.org/wiki/Naming_convention_(programming)#Lisp*

* Naming of **HTTP methods inside of a builder** are **upper flat case** (following https://tools.ietf.org/html/rfc7231#section-4).
    
    *Example:*
    ```fsharp
    http {
        GET "http://www.whatever.com"
    }
    ```

* Naming of **HTTP methods used outside of a builder** follow the F# naming convention and are **flat case**.

    *Example:*
    ```fsharp
    let request = get "http://www.whatever.com"
    ```

* Naming of **HTTP headers inside of a builder** are **PascalCase**. Even though they should be named **train case** (according to https://tools.ietf.org/html/rfc7231#section-5), it would require a double backtic using it in F#, which might be uncomfortable.

    *Example:*
    ```fsharp
    http {
        // ...
        CacheControl "no-cache"
    }
    ```

* Naming of **all other constructs** are **lower camel case**. This applies to:
    * config methods
    * type transformer (like "body")
    * content annotations (like "json" or "text")
    * FSI print modifiers like "expand" or "preview"
    * invocations like "send"

    *Example:*
    ```fsharp
    http {
        // ...
        timeoutInSeconds 10.0
        body
        json """ { ... } """
        expand
    }
    ```

Thank you, that helped. 🙂

If there should come up more issued / ideas or any kind of feedback, feel free to post it.

Of course, Ronald. :)