<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vladimir Shchur on Medium]]></title>
        <description><![CDATA[Stories by Vladimir Shchur on Medium]]></description>
        <link>https://medium.com/@Lanayx?source=rss-ed26b6a4aecb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gy3zaFgBOSPpEKSTpOzH6w.png</url>
            <title>Stories by Vladimir Shchur on Medium</title>
            <link>https://medium.com/@Lanayx?source=rss-ed26b6a4aecb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:02:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Lanayx/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Oxpecker 3]]></title>
            <link>https://medium.com/@Lanayx/oxpecker-3-d26c784133a4?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/d26c784133a4</guid>
            <category><![CDATA[oxpeckers]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[htmx]]></category>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 01:15:26 GMT</pubDate>
            <atom:updated>2026-10-04T05:21:34.401Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSy8GKtkme3k0xFfk6_NJg.png" /><figcaption>Oxpecker in the Fall</figcaption></figure><p>As you might have guessed from the title, a new major version of <strong>Oxpecker</strong> has just landed, which means <a href="https://github.com/Lanayx/Oxpecker">Oxpecker</a> is still alive and continues to evolve! Let’s take a look at what’s in it.</p><h3>Cancellation</h3><p>To be frank, I haven’t really needed to think much about cancellation before. In benchmarks, <strong>Oxpecker</strong> had to serve every single response, and in production applications I never had enough load to justify complicating the logic by passing cancellation tokens around.</p><p>Moreover, while there are specialized computation expressions that can interrupt execution when cancellation is requested, they did not work particularly well for my business flows. Interruptions at arbitrary points would make those flows less predictable. In my cases, it was usually better to let a workflow run to completion even when the user had stopped waiting for the result.</p><p>Nevertheless, there are certainly situations where avoiding unnecessary server-side work makes sense — for example, serializing a response body when the client is no longer listening. This becomes even more important for long-lived streaming responses, such as rendering LLM output.</p><p>That is why, starting with version 3, <strong>Oxpecker</strong> APIs observe <a href="https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontext.requestaborted">HttpContext.RequestAborted</a>. Response writers, streaming handlers, JSON serialization and deserialization, form binding, and multipart responses now propagate the request cancellation token downstream.</p><p>For example, a handler can use the same token for its own work:</p><pre>open System.Threading.Tasks<br>open Microsoft.AspNetCore.Http<br>open Oxpecker<br><br>let slowHandler: EndpointHandler =<br>  fun (ctx: HttpContext) -&gt;<br>    task {<br>      do! Task.Delay(5_000, ctx.RequestAborted)<br>      return! ctx.WriteJson {| Message = &quot;Finished!&quot; |}<br>    }</pre><p>The request-binding and response-writing APIs themselves already observe ctx.RequestAborted, so there is no additional cancellation token to pass to BindForm, BindJson,WriteJson, WriteText, WriteHtmlView, and similar methods.</p><p>The same applies to streaming. An asynchronous producer receives the request cancellation token and can stop producing values as soon as the client disconnects:</p><pre>let streamingJson: EndpointHandler =<br>  fun (ctx: HttpContext) -&gt;<br>    let values =<br>      AsyncEnumerable<br>        .Range(1, 10)<br>        .Select(fun i (ct: CancellationToken) -&gt;<br>          ValueTask&lt;{| Id: int; Name: string |}&gt;(<br>            task {<br>              do! Task.Delay(500, ct)<br>              return {| Id = i; Name = $&quot;Name {i}&quot; |}<br>            }<br>         ))<br>    jsonChunked values ctx</pre><p>For HTML rendering, I had to teach <strong>Oxpecker.ViewEngine</strong> to accept an optional CancellationToken. The Render APIs had originally been designed as functions, so I changed them to static methods. This means losing partial application, but in exchange the API gains extensibility and proper cancellation support and <strong>Oxpecker.ViewEngine</strong> gets a new major version.</p><p>For example, an HTML view can now be rendered directly to a stream with cancellation:</p><pre>Render.toStreamAsync(<br>  stream,<br>  view,<br>  ctx.RequestAborted<br>)</pre><h3>Discriminated unions in OpenAPI</h3><p>Starting with <strong>.NET 11</strong>, System.Text.Json has built-in support for serializing F# discriminated unions, so DUs finally have a standard JSON representation.</p><p>Microsoft.AspNetCore.OpenApi does not currently generate corresponding F# DU schemas out of the box, but it is possible to add that support by writing a custom transformer. <strong>Oxpecker.OpenApi</strong> now provides FSharpUnionSchemaTransformer for exactly this purpose.</p><p>For example:</p><pre>open System.Text.Json.Serialization<br><br>[&lt;JsonPolymorphic(TypeDiscriminatorPropertyName = &quot;kind&quot;)&gt;]<br>type Vehicle =<br>    | [&lt;JsonPropertyName(&quot;bike&quot;)&gt;] Bicycle<br>    | [&lt;JsonPropertyName(&quot;auto&quot;)&gt;] Car of seats: int<br>    | Truck of load: float</pre><p>The transformer can be registered together with the existing F# option transformer:</p><pre>let configureServices (services: IServiceCollection) =<br>    services<br>        .AddRouting()<br>        .AddOxpecker()<br>        .AddOpenApi(fun options -&gt;<br>            options<br>                .AddSchemaTransformer&lt;FSharpOptionSchemaTransformer&gt;()<br>                .AddSchemaTransformer&lt;FSharpUnionSchemaTransformer&gt;()<br>            |&gt; ignore)<br>    |&gt; ignore</pre><p>After that, DUs used by an OpenAPI-enabled endpoint are described correctly:</p><pre>GET [<br>    route &quot;/&quot; (text &quot;Hello World&quot;)<br>    |&gt; addOpenApiSimple&lt;unit, Vehicle&gt;<br>]</pre><p>Vehicle type JSON schema:</p><pre>&quot;Vehicle&quot;: {<br>  &quot;oneOf&quot;: [<br>    {<br>      &quot;const&quot;: &quot;bike&quot;,<br>      &quot;type&quot;: &quot;string&quot;<br>    },<br>    {<br>      &quot;required&quot;: [<br>        &quot;kind&quot;,<br>        &quot;seats&quot;<br>      ],<br>      &quot;type&quot;: &quot;object&quot;,<br>      &quot;properties&quot;: {<br>        &quot;kind&quot;: {<br>          &quot;const&quot;: &quot;auto&quot;,<br>          &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;seats&quot;: {<br>          &quot;pattern&quot;: &quot;^-?(?:0|[1-9]\\d*)$&quot;,<br>          &quot;type&quot;: [<br>            &quot;integer&quot;,<br>            &quot;string&quot;<br>          ],<br>          &quot;format&quot;: &quot;int32&quot;<br>        }<br>      }<br>    },<br>    {<br>      &quot;required&quot;: [<br>        &quot;kind&quot;,<br>        &quot;load&quot;<br>      ],<br>      &quot;type&quot;: &quot;object&quot;,<br>      &quot;properties&quot;: {<br>        &quot;kind&quot;: {<br>          &quot;const&quot;: &quot;truck&quot;,<br>          &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;load&quot;: {<br>          &quot;type&quot;: &quot;string&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p>Fieldless unions become string enums, while unions with data-carrying cases are represented using the corresponding object schemas and discriminators. The transformer also understands custom discriminator names, renamed cases, nullable fields, recursive unions, and other System.Text.Json settings.</p><h3>New HTTP QUERY method</h3><p>With <strong>Oxpecker 3</strong>, routes can also be bound to the <a href="https://www.rfc-editor.org/info/rfc10008/">new standardized HTTP</a> QUERY method.</p><p>Unlike GET, QUERY can carry request content. Unlike POST, it is defined as a safe and idempotent method, making it useful for complex read-only queries that are inconvenient to encode entirely into a URL.</p><p>Using it in Oxpecker looks just like using the existing HTTP method routers:</p><pre>let endpoints = [<br>  QUERY [<br>    route &quot;/search&quot; (fun ctx -&gt;<br>      task {<br>        let! query = ctx.BindJson&lt;{| Filter: string |}&gt;()<br>        return! ctx.WriteText query.Filter<br>      })<br>  ]<br>]</pre><p>Because QUERY is a safe method, Oxpecker also treats it similarly to GET with respect to antiforgery validation (no validation is performed).</p><h3>subRoutef</h3><p>Now you can have type-safe nested routes, similar to routef, OpenAPI support included.</p><pre>let endpoints = [<br>  GET [<br>    subRoutef &quot;/orgs/{%s}/users/{%i}&quot; (fun org userId -&gt; [<br>      route &quot;/info&quot; &lt;| text $&quot;{org}:{userId}&quot;<br>      routef &quot;/posts/{%i}/{%O:guid}&quot; (fun postId (commentId: Guid) -&gt;<br>        text $&quot;{org}:{userId}:{postId}:{commentId}&quot;)<br>    ])<br>  ]<br>]</pre><h3>Multipart responses</h3><p>Multipart media types have been around <a href="https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html">for decades</a>, but first-class support for <strong>multipart responses</strong> is still uncommon — for example, ASP.NET Core does not provide a dedicated API for producing them.</p><p><strong>Htmx 4</strong> makes <a href="https://four.htmx.org/docs#multi-part">interesting use</a> of multipart responses through its hx-multipart <a href="https://four.htmx.org/extensions/hx-multipart">extension</a>. A server can send a multipart/mixed response and flush individual HTML parts as they become available, allowing Htmx to swap them into the DOM progressively.</p><p>A natural use case for this is streamed output, including sequential LLM-generated content.</p><p>Since <strong>Oxpecker</strong> natively <a href="https://github.com/Lanayx/Oxpecker/tree/main/src/Oxpecker.Htmx">supports</a> <strong>Htmx 4</strong>, I decided to add multipart response support as well, giving users proper server-side support for hx-multipart.</p><p>Here is a minimal streaming example:</p><pre>let streamingHtml: EndpointHandler =<br>  fun (ctx: HttpContext) -&gt;<br>    let parts =<br>      &quot;Hello world using Oxpecker streaming!&quot;<br>        .ToAsyncEnumerable()<br>        .Select(fun ch (ct: CancellationToken) -&gt;<br>          ValueTask&lt;IMultipartPart&gt;(<br>            task {<br>              do! Task.Delay(20, ct)<br>              return MultipartPart.Html(raw(string ch))<br>            }<br>          ))<br>    multipartChunked parts ctx</pre><p>Every character is rendered as a separate HTML part and flushed to the client as soon as it is available. Because the asynchronous producer receives ctx.RequestAborted, it also stops naturally when the client disconnects.</p><p>There are built-in part types for HTML, text, JSON, and raw bytes:</p><pre>let parts = [<br>  MultipartPart.Html(<br>    div(id = &quot;progress&quot;) { &quot;Processing...&quot; },<br>      headers = [ &quot;HX-Retarget&quot;, &quot;#progress&quot; ]<br>    )<br>  MultipartPart.Text(&quot;Almost done...&quot;)<br>  MultipartPart.Json(<br>    {| Status = &quot;completed&quot;; Progress = 100 |}<br>  )<br>]<br>multipart parts</pre><p>You can use multipart / WriteMultipart for a buffered response, or multipartChunked / WriteMultipartChunked when the parts should be streamed as they become available.</p><p>As part of this change, I also had to extend the global JSON serializer interface so it can serialize an individual multipart JSON part directly into a PipeWriter:</p><pre>abstract member SerializePart&lt;&#39;T&gt; :<br>    value: &#39;T *<br>    writer: PipeWriter *<br>    cancellationToken: CancellationToken<br>        -&gt; Task</pre><p>MultipartPart.Json resolves the registered IJsonSerializer and calls this method, so custom serializers are respected consistently.</p><p>If you have your own IJsonSerializer implementation but do not plan to use JSON multipart parts, you can simply throw NotImplementedException from the new method for now.</p><p>Unfortunately, F# currently cannot provide a default implementation for an interface member in this scenario, but I <a href="https://github.com/fsharp/fslang-suggestions/issues/1472">created a proposal</a> to add support for it.</p><h3>HTML documentation</h3><p>The new release also documents all HTML tags and attributes.</p><p>This might feel unimportant nowadays, when LLMs generate a loads of code, but there was no good reason to leave such a large part of the public API undocumented.</p><p>The documentation was added to both <strong>Oxpecker.ViewEngine</strong> and <strong>Oxpecker.Solid</strong>, so IDE can now tell you what individual tags and attributes do without requiring you to look them up elsewhere.</p><p>Unfortunately, those documentation comments often can’t be properly displayed, so I opened an <a href="https://github.com/dotnet/fsharp/issues/20646">issue</a> in the F# repository.</p><p><strong>Oxpecker</strong>, <strong>Oxpecker.ViewEngine</strong>, and <strong>Oxpecker.OpenApi</strong> are all currently in beta, so some adjustments are still possible before their stable releases. You are very welcome to try them out and leave your feedback.</p><p>Thank you for reading, and I wish you all the best in your F# endeavors!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d26c784133a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fully leverage Oxpecker (or at least use IResult)?]]></title>
            <link>https://medium.com/@Lanayx/how-to-fully-leverage-oxpecker-or-at-least-use-iresult-fae4a8fcd9d3?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/fae4a8fcd9d3</guid>
            <category><![CDATA[minimal-api]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[oxpeckers]]></category>
            <category><![CDATA[fsharp]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Sun, 16 Aug 2026 19:46:04 GMT</pubDate>
            <atom:updated>2026-08-16T19:46:04.717Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DzbLogCYbvzUuVbU5oMJ8A.png" /><figcaption>Leverage Oxpecker in full</figcaption></figure><p>The idea of this article was born as an extended response to the GitHub <a href="https://github.com/Lanayx/Oxpecker/discussions/99">discussion</a>, but I believe it can be useful for anyone who wants to go beyond Oxpecker’s built-in capabilities to improve code quality.</p><h3>Preface</h3><p>Before going into details I’d like to go back over the history of <a href="https://medium.com/github.com/Lanayx/Oxpecker">Oxpecker</a>.</p><p>For a long time F# carried the label of a “functional” language, which was both a blessing and a curse. On the one hand, there were people who enjoyed the correctness of the code and ease of composition that FP provides; on the other, there were people who pointed to the job market and unusual ML syntax. Today functional features have become a commodity, traditional OOP languages have embraced many FP features, but many developers’ mindsets appear to be more resistant to change.</p><p>Two functional web frameworks dominated the early days of F#: <a href="https://suave.io/">Suave</a> and <a href="https://websharper.com/">Websharper</a> (and they are still both alive!). They were great alternatives to the ASP.NET WebForms, but with the arrival of OWIN, and later ASP.NET Core, F# developers were tempted to choose a high-performance networking stack backed by Microsoft over more “pure”, but lesser known and less benchmarked solutions.</p><p>That was the time when <a href="https://giraffe.wiki/">Giraffe</a> was born (and later <a href="https://www.falcoframework.com/">Falco</a>) as a “functional” ASP.NET Core middleware with routing mechanics similar to Suave’s. Unfortunately (or fortunately) some time later, the ASP.NET Core team built its own fast routing system called <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing">Endpoint routing</a>, so Giraffe had to create a second version of the API, largely incompatible with the first, and had to continue to support both. Oxpecker had the luxury of starting directly with the Endpoint routing.</p><p>Along with that, the ASP.NET Core team released their own “functional” C# framework — Minimal APIs. This approach received a warm reception from the .NET community, which was interesting, because functional APIs were available for a long time in F#, but C# developers were stuck with controllers. Although it looked fresh, Minimal APIs managed to stay quite close to their predecessor — ASP.NET MVC:</p><ul><li>It uses the same DI mechanism</li><li>It returns “results” (IActionResult vs IResult)</li><li>Automatic parameter binding</li><li>Automatic result serialization</li><li>Heavy use of attributes for customization</li><li>Similar to MVC, Minimal API handlers don’t support composition; composition happens at the middleware level</li></ul><p>One of the main and most loved features of Minimal APIs is the automatic generation of the OpenAPI schema, even though it comes with certain downsides:</p><ol><li>It goes against the well-known “schema-first” approach</li><li>It prevents changing the built-in serialization library (System.Text.Json)</li><li>If a handler can return multiple types of results, automation doesn’t work and types need to be specified manually</li><li>It has slightly worse performance</li><li>IResult instances are not composable</li></ol><p>People want this feature so much, that they suggest rewriting Oxpecker using IResult. We’ll return to that soon, but let’s first revisit what Oxpecker’s value actually is (except being a <a href="https://medium.com/@Lanayx/the-oxpecker-ef9df3dfb918">fork of Giraffe</a>)?</p><h3>Oxpecker basics</h3><p>Oxpecker’s composition strategy is based on two core types:</p><pre>type EndpointHandler = HttpContext -&gt; Task<br>type EndpointMiddleware = EndpointHandler -&gt; EndpointHandler</pre><p>These function types allow handlers and middleware to be composed with each other. They also make it easy for the user to extend them with custom filters or data transformations.</p><pre>let setCorrelationId : EndpointMiddleware =<br>  fun (next: EndpointHandler) (ctx: HttpContext) -&gt;<br>    if ctx.TryGetHeaderValue(&quot;CorrelationId&quot;).IsNone then<br>      ctx.SetHttpHeader(&quot;CorrelationId&quot;, Guid.NewGuid().ToString())<br>    next ctx<br><br>let checkTenantId : EndpointMiddleware =<br>  fun (next: EndpointHandler) (ctx: HttpContext) -&gt;<br>    if ctx.TryGetHeaderValue(&quot;TenantId&quot;).IsNone then<br>      ctx.SetStatusCode 400<br>      ctx.WriteText(&quot;TenantId header is required&quot;)<br>    else<br>      next ctx<br><br>GET [<br>  route &quot;/test&quot; (setCorrelationId &gt;=&gt; checkTenantId &gt;=&gt; text &quot;Hello World&quot;)<br>]</pre><p>It is also possible to set a filter at the endpoint level:</p><pre>GET [<br>  route &quot;/test&quot; (text &quot;Hello World&quot;)<br>  |&gt; addFilter (setCorrelationId &gt;=&gt; checkTenantId)<br>]</pre><p>Or on an endpoint group:</p><pre>GET [<br>  route &quot;/test&quot; (text &quot;Hello World&quot;)<br>]<br>|&gt; addFilter (setCorrelationId &gt;=&gt; checkTenantId)</pre><p>But avoid using addFilter multiple times, because the filters must be added in reverse order:</p><pre>GET [<br>  route &quot;/test&quot; (text &quot;Hello World&quot;)<br>  |&gt; addFilter checkTenantId<br>  |&gt; addFilter setCorrelationId<br>]</pre><p>You can even use a built-in ASP.NET Core endpoint filter (with its special types):</p><pre>GET [<br>  route &quot;/test&quot; &lt;| text &quot;Hello World&quot;<br>]<br>|&gt; configureEndpoint _.AddEndpointFilter(<br>  fun (ctx: EndpointFilterInvocationContext) (next: EndpointFilterDelegate) -&gt;<br>    ctx.HttpContext.SetHttpHeader(&quot;X-Test&quot;, &quot;true&quot;)<br>    next.Invoke(ctx)<br>  )</pre><p>HttpContext is a cornerstone type in Oxpecker. It is both a part of the core function types and the target of a set of useful extensions and their functional counterparts, which can be combined with handlers and with each other.</p><pre>type Person = { Name: string }<br>let greetHandler (p: Person) =<br>    setStatusCode 201 &gt;=&gt; json { Name = $&quot;Hello {p.Name}!&quot; }<br><br>GET [<br>  route &quot;/greet&quot; (setCorrelationId &gt;=&gt; bindJson greetHandler)<br>]</pre><p>Built-in extensions and functions simplify the most common cases, but users are encouraged to replace or extend them with their desired implementations.</p><pre>// custom verb group<br>let GET_HEAD_OPTIONS : Endpoint seq -&gt; Endpoint =<br>    applyHttpVerbsToEndpoints(Verbs [ HttpVerb.GET; HttpVerb.HEAD; HttpVerb.OPTIONS ])<br>// usage<br>GET_HEAD_OPTIONS [ route &quot;/test&quot; &lt;| text &quot;Hello&quot; ]<br><br>// custom serializer<br>let xml (value: &#39;T) (ctx: HttpContext) =<br>    let serializer = XmlSerializer(typeof&lt;&#39;T&gt;)<br>    use writer = new StreamWriter(ctx.Response.Body)<br>    serializer.Serialize(writer, value)<br>    writer.FlushAsync()<br>// usage<br>GET [ route &quot;/test&quot; &lt;| xml { Name = &quot;Joe&quot; }]<br><br>// custom route function<br>let routeAndBind (path: string) =<br>    route path &lt;&lt; bindJson<br>// usage<br>type Person = { Name: string }<br>let greetHandler (p: Person) =<br>    json { Name = $&quot;Hello {p.Name}!&quot; }<br>GET [ routeAndBind &quot;/greet&quot; greetHandler ]</pre><p>Lastly, I think that Oxpecker’s greatest strength is its HTML view engine, but it’s not directly relevant to the current topic, so I won’t expand about it here (you can read about it <a href="https://medium.com/@Lanayx/7-reasons-to-try-oxpecker-viewengine-af642b4d191c">in another article</a>).</p><p>Let’s summarize, what we’ve learnt so far:</p><ul><li>Oxpecker inherits functional features that allow straightforward composition of handlers and middlewares.</li><li>It provides simple primitives for working with HttpContext and encourages users to extend and customize them.</li></ul><h3>Returning to IResult</h3><p>Instead of being a functional type, IResult is an interface with a single method that has the same signature as Oxpecker’s EndpointHandler, but may feel more natural for OOP-oriented developers.</p><pre>public interface IResult<br>{<br>  Task ExecuteAsync(HttpContext httpContext);<br>}</pre><p>It also serves as a common interface for TypedResult implementations, which are later used for schema generation (either by reflection or source generation).</p><p>Is there any use for IResult except for the OpenAPI schema generation? The answer is yes, it’s useful for writing testable logic that doesn’t interact with HttpContext directly but conditionally returns different HTTP status codes and response bodies.</p><pre>IResult Handler(string? name) =&gt;<br>    string.IsNullOrWhiteSpace(name)<br>        ? TypedResults.BadRequest(&quot;A name is required.&quot;)<br>        : TypedResults.Ok($&quot;Hello, {name}!&quot;);<br><br>app.MapGet(&quot;/hello&quot;, Handler);</pre><p>Ironically, this useful case prevents automatic OpenAPI schema inference. To make it work, you’ll need to manually specify a peculiar return type, so that the actual typed results will be implicitly converted to it.</p><pre>Results&lt;Ok&lt;string&gt;, BadRequest&lt;string&gt;&gt; Handler(string? name) =&gt;<br>    string.IsNullOrWhiteSpace(name)<br>        ? TypedResults.BadRequest(&quot;A name is required.&quot;) // implicit cast<br>        : TypedResults.Ok($&quot;Hello, {name}!&quot;); // implicit cast<br><br>app.MapGet(&quot;/hello&quot;, Handler);</pre><p>Now let’s try to implement this with Oxpecker. Note, that although the C# version doesn’t say anything about it, but name should come from query parameter; in F#, this should be done explicitly.</p><pre>// initial try<br>let handler (ctx: HttpContext) =<br>    task {<br>        match ctx.TryGetQueryValue(&quot;name&quot;) with<br>        | Some name when not (String.IsNullOrEmpty name) -&gt;<br>            return! %TypedResults.Ok($&quot;Hello, {name}!&quot;) &lt;| ctx<br>        | _ -&gt;<br>            return! %TypedResults.BadRequest(&quot;A name is required.&quot;) &lt;| ctx<br>    }</pre><p>Since we need an HttpContext instance to get the query value and write the response, we can’t easily test this. Let’s therefore perform a functional decomposition (and add OpenAPI definition as well).</p><pre>// universal query parameter retriever<br>let getQueryStringParam paramName (ctx: HttpContext)  =<br>    ctx.TryGetQueryValue paramName<br>    |&gt; Option.filter (String.IsNullOrWhiteSpace &gt;&gt; not)<br><br>// desired testable handler<br>let pureHandler (name: string option) : IResult =<br>    match name with<br>    | Some name -&gt; TypedResults.Ok $&quot;Hello, {name}!&quot;<br>    | None -&gt; TypedResults.BadRequest &quot;A name is required.&quot;<br><br>// route setup<br>GET [<br>  route &quot;/hello&quot; (<br>    fun ctx -&gt; ctx |&gt; getQueryStringParam &quot;name&quot; |&gt; pureHandler |&gt; ctx.Write<br>  )          <br>    |&gt; addOpenApi(<br>      OpenApiConfig(<br>        responseBodies = [<br>          ResponseBody(typeof&lt;string&gt;, [| &quot;application/json&quot; |], 200)<br>          ResponseBody(typeof&lt;string&gt;, [| &quot;application/json&quot; |], 400)<br>        ],<br>        configureOperation = (fun operation _ _ -&gt;<br>          let param =<br>              OpenApiParameter(<br>                  Name = &quot;name&quot;,<br>                  In = ParameterLocation.Query,<br>                  Schema = OpenApiSchema(Type = JsonSchemaType.String)<br>              ) :&gt; IOpenApiParameter<br>          let parameters = ResizeArray()<br>          parameters.Add(param)<br>          operation.Parameters &lt;- parameters<br>          Task.CompletedTask<br>        )<br>      )<br>    )<br>]</pre><p>While this works, the ctx passing is not that pretty, and OpenAPI description is verbose. Can we improve it? Let’s add several reusable helper functions:</p><pre>let transform (f: HttpContext -&gt; IResult) (ctx: HttpContext) =<br>    ctx |&gt; f |&gt; ctx.Write<br><br>let routei (path: string) (handler: HttpContext -&gt; IResult) =<br>    route path (transform handler)<br><br>let json200&lt;&#39;T&gt; =<br>    ResponseBody(typeof&lt;&#39;T&gt;, [| &quot;application/json&quot; |], 200)<br><br>let json400&lt;&#39;T&gt; =<br>    ResponseBody(typeof&lt;&#39;T&gt;, [| &quot;application/json&quot; |], 400)<br><br>let addQueryStringParam (name: string) (operation: OpenApiOperation) =<br>    let p =<br>        OpenApiParameter(<br>            Name = name,<br>            In = ParameterLocation.Query,<br>            Schema = OpenApiSchema(Type = JsonSchemaType.String)<br>        ) :&gt; IOpenApiParameter<br>    match operation.Parameters with<br>    | null -&gt;<br>        let parameters = ResizeArray()<br>        parameters.Add(p)<br>        operation.Parameters &lt;- parameters<br>    | parameters -&gt;<br>        parameters.Add(p)<br></pre><p>And then our route looks quite slick:</p><pre>GET [<br>  routei &quot;/hello&quot; (getQueryStringParam &quot;name&quot; &gt;&gt; pureHandler)<br>  |&gt; addOpenApi(OpenApiConfig(<br>      responseBodies = [ json200&lt;string&gt;; json400&lt;string&gt; ],<br>      configureOperation = (fun operation _ _ -&gt;<br>        operation |&gt; addQueryStringParam &quot;name&quot;<br>        Task.CompletedTask<br>      )<br>    ))<br>]</pre><h3>Summary</h3><p>In this article we’ve observed Oxpecker’s basic building blocks and its functional nature, explored ways to extend its APIs with custom functionality and applied that knowledge to create a thin API layer that enables the use of IResult in your application.</p><p><em>That’s it, thank you for reading and don’t forget to click on the “Clap” button if you like this article!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fae4a8fcd9d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meet Oxpecker.Alpine and Oxpecker.Htmx beta]]></title>
            <link>https://medium.com/@Lanayx/meet-oxpecker-alpine-and-oxpecker-htmx-beta-8b1dc7ebf89e?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b1dc7ebf89e</guid>
            <category><![CDATA[alpinejs]]></category>
            <category><![CDATA[oxpeckers]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[htmx]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 15:28:37 GMT</pubDate>
            <atom:updated>2026-06-18T22:29:23.365Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAD1B-rBMAqfIJIZc4TxwA.png" /><figcaption>Oxpecker + Htmx + Alpine = ❤️</figcaption></figure><p>This post introduces new Oxpecker “built-in” wrappers for two relatively popular JavaScript frameworks.</p><p>Although <a href="https://alpinejs.dev/"><strong>Alpine.js</strong></a><strong> </strong>and <a href="https://htmx.org/"><strong>Htmx.js</strong></a><strong> </strong>are two separate libraries with independent authors, they are commonly used together and not without a reason:</p><ul><li>I’ve never had a real project where using <em>only </em><strong>Htmx</strong> was possible and it’s difficult to come up with one, since client-only interactions are almost always required here and there.</li><li>It’s hard to justify using <em>just </em><strong>Alpine</strong> for JavaScript-based frontends, because it is just less powerful, performant and convenient compared to more popular alternatives (where <strong>Solid.js</strong> is still my top choice)</li><li>But together they work just right with <strong>Htmx</strong> doing most of the heavy lifting and <strong>Alpine</strong> being used on demand, where interaction without any server communication is preferable. FWIW, <strong>Alpine</strong> is recommended by the authors of the main <a href="https://hypermedia.systems/">Htmx book</a>.</li></ul><p><a href="https://www.nuget.org/packages/Oxpecker.Htmx">Oxpecker.Htmx</a> has been published for a while, but I always felt that <strong>Oxpecker.Alpine</strong> was missing. I did try to come up with the API similar to <strong>Htmx</strong> one few years ago, but didn’t succeed, so only returned back to this task after I heard about new <a href="https://four.htmx.org/">Htmx version 4</a> coming.</p><p><strong>Htmx4</strong> bring lots of breaking changes, actually so many, that migrating a tiny project took me several days. I honestly don’t think there is a big reason to migrate an existing big project to v4, since v2 is going to be supported just as long as v4. The changes include removing or renaming attributes and headers, changing event names and object structures, changing extension rules, changing the request engine and many other things. It is a huge update of both API and internals.</p><p>However, when you are starting a greenfield project, jumping straight to v4 makes much bigger sense, so I decided that <a href="https://github.com/Lanayx/Oxpecker">Oxpecker</a> users shouldn’t miss out and started working on a wrapper for v4. At the same time I kept <strong>Alpine</strong> in mind, so both libraries could be accessed using similar API.</p><p><strong>Htmx4</strong> and <strong>Alpine</strong> attributes are not just some regular attributes, take a look at their format:</p><pre>&lt;!-- Htmx4 inheritance --&gt;<br>&lt;div hx-include:inherited=&quot;#global-fields&quot;&gt;<br>    &lt;form hx-include:inherited:append=&quot;.extra&quot;&gt;...&lt;/form&gt;<br>&lt;/div&gt;<br><br>&lt;!-- Htmx4 modifiers and extended selectors --&gt;<br>&lt;div hx-swap=&quot;innerHTML scroll:top scrollTarget:#other&quot;&gt;...&lt;/div&gt;<br><br>&lt;!-- Alpine.js events --&gt;<br>&lt;button x-on:click=&quot;message = &#39;changed&#39;&quot;&gt;...&lt;/button&gt;<br><br>&lt;!-- Alpine.js modifiers --&gt;<br>&lt;div @scroll.window.throttle.750ms=&quot;handleScroll&quot;&gt;...&lt;/div&gt;</pre><p>After several attempts I figured out that keeping their attributes as setter properties is no longer feasible. The best solution I found was to rely on extension methods for special attributes, just like for event handlers. With <a href="https://www.nuget.org/packages/Oxpecker.Htmx">Oxpecker.Htmx</a> and <a href="https://www.nuget.org/packages/Oxpecker.Alpine">Oxpecker.Alpine</a> the HTML examples above now translate into the following:</p><pre>// Htmx4 inheritance (option 1)<br>div().hxInclude(&quot;#global-fields&quot;, &quot;:inherited&quot;) {<br>    form().hxInclude(&quot;.extra&quot;, &quot;:inherited:append&quot;)<br>}<br><br>// Htmx4 inheritance (option 2)<br>div().hxInclude(&quot;#global-fields&quot;, HxModifier.inherited) {<br>    form().hxInclude(&quot;.extra&quot;, HxModifier.inherited + HxModifier.append)<br>}<br><br>// Htmx4 modifiers and extended selectors (option 1)<br>div().hxSwap(&quot;innerHTML scroll:top scrollTarget:#other&quot;)<br><br>// Htmx4 modifiers and extended selectors (option 2)<br>div().hxSwap(HxSwapMethod.innerHtml<br>             + HxSwapModifier.scroll &quot;top&quot;<br>             + HxSwapModifier.scrollTarget &quot;#other&quot;)<br><br>// Alpine.js events<br>button().xOn(&quot;click&quot;, &quot;message = &#39;changed&#39;&quot;)<br><br>// Alpine.js modifiers (option 1)<br>div().xOn(&quot;scroll.window.throttle.750ms&quot;, &quot;handleScroll&quot;)<br><br>// Alpine.js modifiers (option 2)<br>div().xOn(&quot;scroll&quot; <br>          + XOnModifier.window <br>          + XOnModifier.throttleMs 750, &quot;handleScroll&quot;)</pre><p>I’ve decided to proceed with the string-based API, since it can be used both with module helpers (humans) and plain constant strings (LLMs). <br>Performance-wise, constant strings are preferred, but I have big hopes that JIT-compiler will be able to optimize concatenation of constant strings in .NET 11.</p><p>I’ve used it in a small pet project and found the separation between standard HTML attributes (they are still properties) and extension method quite convenient. Modifier modules surprisingly serve as a good documentation of what is allowed by <strong>Alpine</strong>.</p><p>The packages have been published (<a href="https://www.nuget.org/packages/Oxpecker.Htmx">Oxpecker.Htmx</a>, <a href="https://www.nuget.org/packages/Oxpecker.Alpine">Oxpecker.Alpine</a>), documentation (<a href="https://lanayx.github.io/Oxpecker/src/Oxpecker.Htmx/">Oxpecker.Htmx</a>, <a href="https://lanayx.github.io/Oxpecker/src/Oxpecker.Alpine/">Oxpecker.Alpine</a>) and <a href="https://github.com/Lanayx/Oxpecker/tree/main/examples">examples</a> . One thing to note, the <strong>Htmx</strong> package is still <a href="https://cdn.jsdelivr.net/npm/htmx.org@next/dist/">in beta</a>, so the corresponding <strong>Oxpecker</strong> package is in beta as well. Second thing to note — as <strong>Htmx</strong> jumped from v2 to v4, I decided to respect the author and bump<strong> Oxpecker.Htmx</strong> from v2 to v4 as well, hopefully this won’t be confusing to users.</p><p>As a side note, all <strong>Oxpecker</strong> packages now contain both xml documentation and <a href="https://github.com/dotnet/sourcelink">source link</a> information, which helps to navigate through <strong>Oxpecker</strong> APIs using IDE. And if you mainly use AI agents, you are also covered, since I’ve published a <a href="https://github.com/Lanayx/PipedSkills/tree/main/skills/nuget-public-api">skill</a> that allows agents to explore any public Nuget package API using reflection.</p><p>Thank you for reading and happy to hear any feedback about the published libraries!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b1dc7ebf89e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I use Rider for F# web development]]></title>
            <link>https://medium.com/@Lanayx/how-i-use-rider-for-f-web-development-b6534e7cd969?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6534e7cd969</guid>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[oxpeckers]]></category>
            <category><![CDATA[jetbrains-rider]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Mon, 25 May 2026 22:29:08 GMT</pubDate>
            <atom:updated>2026-08-18T08:03:50.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*claNijSkaYAzhn4s6Zt1hA.png" /><figcaption>F# and Rider on the web</figcaption></figure><p>Although the AI era has already started and some people claim that they don’t write code anymore, that’s not the case for me. While agents <em>can</em> write a lot of “meat”, I prefer to create structure of a project and first few examples myself. I prefer doing very small updates by hand as well, as it takes less time than explaining such changes to agents.</p><p>To read/write code you still need an IDE, so I’d like to share a few tweaks that help me achieve my goals with Rider. Examples will be for <a href="https://github.com/Lanayx/Oxpecker">Oxpecker</a> framework, as I use it a lot.</p><h3>Embedded languages highlighting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*niM85Hnd8BZMadUppvdHrg.png" /><figcaption>Embedded language highlighting</figcaption></figure><p>Directly observing inline CSS and JavaScript helps me quickly understand the code structure and current set values. To achieve this, the attributes and parameters in Oxpecker are decorated with LanguageInjectionAttribute , which can be found in <a href="https://www.nuget.org/packages/Jetbrains.Annotations">Jetbrains.Annotations</a> package, or defined right in <a href="https://github.com/Lanayx/Oxpecker/blob/develop/src/Oxpecker.ViewEngine/IdeTweaks.fs">your code</a>!</p><p>For example, this is how attribute is applied for the style attribute from above:</p><pre>[&lt;LanguageInjection(InjectedLanguage.CSS, Prefix = &quot;.x{&quot;, Suffix = &quot;;}&quot;)&gt;]<br>member this.style<br>    with set (value: string | null) = this.attr(&quot;style&quot;, value) |&gt; ignore</pre><p>Sometimes I move inline scripts outside of markup and in those cases embedded language can be enabled through the comments:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*Fw-0IIHtHQqjj84l0evmLA.png" /><figcaption>Embedded language through comments</figcaption></figure><h3>Tailwind support</h3><p>I mostly use Tailwind CSS in my projects. Not only do I find it very convenient and friendly for changes, but also AI agents are very good at generating Tailwind classes. However, it’s difficult to manually intervene in lists of such classes without IDE support. Setting up tailwind support is quite a quest, fortunately I’ve figured it out for you. Here are the minimal steps for Tailwind v4 (if you load it <a href="https://tailwindcss.com/docs/installation/play-cdn">from CDN</a>):</p><h4>1. Install tailwind</h4><p>This means you need to have <strong>package.json</strong> file with “tailwindcss” package installed. Even if you have several server projects in your solution, you only need one <strong>package.json</strong> file in the root:</p><pre>{<br>  &quot;private&quot;: &quot;true&quot;,<br>  &quot;name&quot;: &quot;tailwind.autocomplete&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;devDependencies&quot;: {<br>    &quot;tailwindcss&quot;: &quot;^4.1.14&quot;<br>  }<br>}</pre><h4>2. Create css file with tailwind imported</h4><p>This has to be done for each web project. For example, <strong>index.css</strong> in its root:</p><pre>@import &quot;tailwindcss&quot;;</pre><h4>3. Update tailwind configuration in Rider</h4><p>The path is <em>Languages &amp; Frameworks -&gt; Style Sheets -&gt; Tailwind CSS. </em>I’m providing configuration for Oxpecker, for other F# frameworks, it should be similar. The following sections should be updated:</p><pre>{<br>  // ...<br>  &quot;includeLanguages&quot;: {<br>    // ...<br>    &quot;fsharp&quot;: &quot;javascript&quot;<br>  },<br>  // ...<br>  &quot;experimental&quot;: {<br>    // ...<br>    &quot;classRegex&quot;: [<br>      [&quot;class&#39;\\s*=\\s*\\$?\&quot;(.*?)\&quot;&quot;],<br>      [&quot;class&#39;\\s*=\\s*\\$?\&quot;\&quot;\&quot;([\\s\\S]*?)\&quot;\&quot;\&quot;&quot;]<br>    ]<br>  }<br>}</pre><p>First RegEx line handles single-line cases, second line handles multi-line cases.</p><h4>4. Restart Rider</h4><p>Although in theory just restart of tailwind server is required, in practice you often have to restart the whole IDE to make it work</p><p>In many cases the CDN solution might not serve your needs (it can be too heavy), so you’ll need to do more configurations to build a dedicated bundle for your app. Then you’ll have to perform additional steps:</p><h4>5. Add sources</h4><p>You need to specify locations of your F# view files in <strong>index.css</strong>, for example:</p><pre>@source &quot;../Views/**/*.fs&quot;;</pre><h4>6. Add tailwind CLI to package.json</h4><pre>{<br>  // ...<br>  &quot;scripts&quot;: {<br>    &quot;css:build&quot;: &quot;npx @tailwindcss/cli -i src/MyApp/wwwroot/styles.css -o src/MyApp/wwwroot/dist/styles.css --minify&quot;,<br>    &quot;css:watch&quot;: &quot;npx @tailwindcss/cli -i src/MyApp/wwwroot/styles.css -o src/MyApp/wwwroot/dist/styles.css --watch&quot;,<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;@tailwindcss/cli&quot;: &quot;^4.1.4&quot;<br>  }<br>}</pre><p>One command is to build a bundle, another is to continuously monitor source files for new tailwind classes and rebuild bundles automatically.</p><p>Once you do all the required steps, you’ll get tailwind support, which I find very helpful. Not only it explains classes on hover, but even suggests refactoring possibilities:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*fRDjrtEJY6n6FgDPxeaskg.png" /><figcaption>Tailwind refactoring hints</figcaption></figure><h3>AI-related features</h3><p>Ability to quickly get sources either by library decompilation or by using <a href="https://github.com/dotnet/sourcelink">SourceLink</a> is one of the primary IDE features that I use every day.</p><p>But just as this feature is essential for me, it is essential for AI agents. Although there are some <a href="https://github.com/davidfowl/dotnet-skillz/blob/main/skills/ilspy-decompile/SKILL.md">other implementations</a>, they often require third-party dependencies, so I just vibe-coded just another skill that can leverage both reflection and source link to provide an agent with the public API to the nuget library. You can find it here: <a href="https://github.com/Lanayx/PipedSkills/tree/main/skills/inspect-nuget-package">https://github.com/Lanayx/PipedSkills/tree/main/skills/inspect-nuget-package</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ziO8tJ6JTviQIZLgGJ-BYA.png" /><figcaption>Skill invocation example</figcaption></figure><p>My main AI harness today is <a href="https://opencode.ai/">OpenCode</a>. I’ve found that it works much better in Linux environment, so I use Windows WSL, which I access from Rider console window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*l-f0hhQjtU7AqAl5j2jDAQ.png" /><figcaption>WSL access</figcaption></figure><p>I hope that some of these small tweaks can add even more fun to your F# web endeavors!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6534e7cd969" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[To vibe code, or not to vibe code?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Lanayx/to-vibe-code-or-not-to-vibe-code-9c31babe8f99?source=rss-ed26b6a4aecb------2"><img src="https://cdn-images-1.medium.com/max/1792/0*VkETKrGuuP3UD7yc" width="1792"></a></p><p class="medium-feed-snippet">I know how to write proper code. I have 15+ year of hands-on experience behind me. I was also an early adopter of Github Copilot and have&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@Lanayx/to-vibe-code-or-not-to-vibe-code-9c31babe8f99?source=rss-ed26b6a4aecb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Lanayx/to-vibe-code-or-not-to-vibe-code-9c31babe8f99?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c31babe8f99</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Mon, 16 Feb 2026 03:03:35 GMT</pubDate>
            <atom:updated>2026-02-18T16:18:31.627Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Oxpecker 2]]></title>
            <link>https://medium.com/@Lanayx/the-oxpecker-2-dbeef82249f5?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbeef82249f5</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[oxpeckers]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[advent]]></category>
            <category><![CDATA[fsharp]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 01:29:50 GMT</pubDate>
            <atom:updated>2025-12-01T01:29:50.536Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUS_Z_8d6waW7y33DSYRGA.png" /><figcaption>Oxpecker is ready for new adventures</figcaption></figure><p><em>There is such a time of year when people temporarily stop their routine tasks and endeavors, find a warm and cozy place, and start waiting for something good with awe and hope. </em>🎄</p><p>As you might have correctly guessed, I’m talking about F# developers and the traditional December Advent of articles about their beloved tool, and I’m very excited to open it this year with (hopefully) good news 🎉.</p><h3>Oxpecker 2 has been released!</h3><p>If you are unfamiliar with <a href="https://www.nuget.org/packages/Oxpecker">Oxpecker</a> and its history, you can start with the previous materials: <a href="https://medium.com/@lanayx/the-oxpecker-ef9df3dfb918">introduction</a>, <a href="https://medium.com/@lanayx/blazor-vs-oxpecker-067cbcda9f99">Blazor comparison</a>, <a href="https://medium.com/@lanayx/7-reasons-to-try-oxpecker-viewengine-af642b4d191c">ViewEngine performance</a> and the <a href="https://www.youtube.com/watch?v=RS7X0UXca-s">video about Oxpecker’s performance</a>.</p><h4>Quick recap</h4><p>If you are not actively following Oxpecker’s development, let me quickly mention features added after the first introduction article:</p><blockquote>GetLogger extension method allowing a categoryName</blockquote><pre>let myLogger = ctx.GetLogger(&quot;MyModule&quot;)</pre><blockquote>IResult native support</blockquote><pre>return! ctx.Write(TypedResults.Ok &quot;Hello world&quot;)</pre><blockquote><a href="https://x.com/Lanayx/status/1813590586525712826">Html streaming</a></blockquote><pre>return! ctx.WriteHtmlChunked(taskSeq { raw &quot;1&quot;; raw &quot;2&quot; })</pre><blockquote>Aria attributes support in ViewEngine</blockquote><pre>div(ariaErrorMessage = &quot;error&quot;)</pre><blockquote>Htmx support</blockquote><pre>button(hxDelete= $&quot;/contacts/{contactId}&quot;, hxPushUrl=&quot;true&quot;)</pre><blockquote>OpenApi support</blockquote><pre>routef &quot;/text/{%s}&quot; text |&gt; addOpenApiSimple&lt;unit, string&gt;</pre><blockquote>configureEndpoint function</blockquote><pre>route &quot;/text&quot; (text &quot;Hi&quot;) |&gt; configureEndpoint _.WithName(&quot;GetText&quot;)</pre><blockquote>Model Validation</blockquote><pre>let! validationResult = ctx.BindAndValidateForm&lt;MyDTO&gt;()</pre><blockquote>Nullable reference types</blockquote><p>All Oxpecker APIs have been annotated with NRT.</p><blockquote>Performance</blockquote><p>Various performance improvements were made for ViewEngine rendering as well as <a href="https://x.com/Lanayx/status/1917304813173498195">model binding</a>.</p><blockquote>Documentation site</blockquote><p><a href="https://lanayx.github.io/Oxpecker/">Oxpecker documentation</a></p><blockquote>Examples</blockquote><p>Multiple example projects <a href="https://github.com/Lanayx/Oxpecker/tree/main/examples">were added</a>: traditional Weather app, CRUD with DI, HTMX Contact app, MCP integration and empty templates.</p><p>Fast forward to December 1st, 2025 and the new release of server-side packages. What is included?</p><h4>Security improvements</h4><p>Oxpecker 2 comes <a href="https://github.com/Lanayx/Oxpecker/pull/83">with CSRF protection</a> enabled by default, if you add the built-in <a href="https://learn.microsoft.com/en-us/aspnet/core/security/anti-request-forgery">Antiforgery Middleware</a> to the pipeline:</p><pre>let configureApp (appBuilder: WebApplication) =<br>  appBuilder<br>    .UseRouting()<br>    .UseAntiforgery() // add between UseRouting and UseOxpecker<br>    .UseOxpecker(endpoints) |&gt; ignore<br><br>let configureServices (services: IServiceCollection) =<br>  services<br>    .AddRouting()<br>    .AddAntiforgery() // don&#39;t forget about the DI<br>    .AddOxpecker()<br>  |&gt; ignore</pre><p>Default protection means that your POST, PUT and PATCH requests will be validated using <em>AntiForgery Middleware</em>, but the validation result will only be checked when bindForm or .BindForm is executed. This behavior matches the behavior of Minimal APIs framework, but you can still do manual validation using antiforgery.ValidateRequestAsync by writing custom EndpointMiddleware even before model binding or for other HTTP methods.</p><p>To place antiforgery token in a form as a hidden input, you should use the GetAntiforgeryInput extension method:</p><pre>let myForm (ctx: HttpContext) =<br>  form() {<br>    ctx.GetAntiforgeryInput()<br>    input(type&#39;=&quot;text&quot;, name=&quot;Message&quot;, value=&quot;Hello&quot;)<br>    button(type&#39;=&quot;submit&quot;) { &quot;Submit&quot; }<br>  }</pre><p>If you don’t use Oxpecker.ViewEngine or prefer header to a form field, you can leverage GetAntiforgeryTokens extension method instead.</p><p>One more security improvement is that ViewEngine <a href="https://github.com/Lanayx/Oxpecker/commit/f94f9067897d8377e03d5c9f1db3e2aaa8622c52">no longer</a> uses the shared ArrayPool for rendering.</p><h4>OpenAPI improvements</h4><p>In the new release Oxpecker’s API has been updated to be compatible with the new version of the <strong>Microsoft.AspNetCore.OpenApi</strong> package. While addOpenApiSimple function hasn’t changed, the configuration object passed to addOpenApi actually has, now the configureOperation parameter requires three arguments:</p><pre>type OpenApiConfig<br>  (<br>    ?requestBody: RequestBody,<br>    ?responseBodies: ResponseBody seq,<br>    ?configureOperation: OpenApiOperation -&gt; OpenApiOperationTransformerContext -&gt; CancellationToken -&gt; Task<br>  )</pre><p>This also fixes <a href="https://github.com/Lanayx/Oxpecker/issues/78">the issue</a> that required you to use <strong>Swashbuckle.AspNetCore</strong> for OpenAPI schema generation in .NET 9, so in .NET 10 you have both options available.</p><p>Another added feature is better handling of F# options (and value options) in the generated schema. While there is still <a href="https://github.com/dotnet/aspnetcore/issues/59528">an open issue</a> to add it by default, it looks like the ASP.NET Core team doesn’t prioritize F# tickets, so<strong> Oxpecker.OpenApi </strong>now provides a transformer to deal with it.</p><p>Here is how the schema looks for the following simple type:</p><pre>[&lt;CLIMutable&gt;]<br>type MyType = {<br>  Field: int option<br>}</pre><p><em>Note: without [&lt;CLIMutable&gt;] attribute, the type’s fields will be marked as required (this is a System.Text.JSON specific behavior).</em></p><p><strong>Before:</strong></p><pre>&quot;FSharpOptionOfint&quot;: {<br>  &quot;pattern&quot;: &quot;^-?(?:0|[1-9]\\d*)$&quot;,<br>  &quot;type&quot;: [<br>    &quot;integer&quot;,<br>    &quot;string&quot;<br>  ]<br>},<br>&quot;MyType&quot;: {<br>  &quot;type&quot;: &quot;object&quot;,<br>  &quot;properties&quot;: {<br>    &quot;field&quot;: {<br>      &quot;oneOf&quot;: [<br>        {<br>          &quot;type&quot;: &quot;null&quot;<br>        },<br>        {<br>          &quot;$ref&quot;: &quot;#/components/schemas/FSharpOptionOfint&quot;<br>        }<br>      ]<br>    }<br>  }<br>}</pre><p><strong>After:</strong></p><pre>&quot;MyType&quot;: {<br>  &quot;type&quot;: &quot;object&quot;,<br>  &quot;properties&quot;: {<br>    &quot;field&quot;: {<br>      &quot;pattern&quot;: &quot;^-?(?:0|[1-9]\\d*)$&quot;,<br>      &quot;type&quot;: [<br>        &quot;null&quot;,<br>        &quot;integer&quot;,<br>        &quot;string&quot;<br>      ],<br>      &quot;format&quot;: &quot;int32&quot;<br>    }<br>  }<br>}</pre><p>You can learn more about ASP.NET Core OpenAPI updates and configuration in the corresponding <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/aspnetcore-openapi">documentation</a>.</p><h4>Default handler and middleware</h4><p>Over these years I’ve found myself copying two pieces of code from one project to another — <em>Exception middleware </em>and <em>NotFound handler. </em>So, I finally thought: why not include them in Oxpecker so others can save some time as well?</p><blockquote><strong>Default.exceptionMiddleware</strong></blockquote><ul><li>Logs all exceptions using <em>Oxpecker.Default.ExceptionMiddleware </em>category</li><li>Returns HTTP status code <strong>400</strong> for <em>ModelBindException </em>and<em> RouteParseException</em></li><li>Returns HTTP status code <strong>403</strong> for <em>AntiforgeryValidationException</em></li><li>Returns HTTP status code <strong>500</strong> for other unhandled exceptions</li></ul><blockquote><strong>Default.notFoundHandler</strong></blockquote><ul><li>Logs all requests using <em>Oxpecker.Default.NotFoundHandler</em> category</li><li>Returns HTTP status code <strong>404</strong></li></ul><p>Since I think those are useful additions to have by default, I’ve updated the <a href="https://github.com/Lanayx/Oxpecker/tree/main/examples/Empty">Empty template project</a>:</p><pre>let builder = WebApplication.CreateBuilder(args)<br>builder.Services.AddRouting().AddOxpecker() |&gt; ignore<br>let app = builder.Build()<br>app.UseRouting()<br>  .Use(Default.exceptionMiddleware)<br>  .UseOxpecker(endpoints)<br>  .Run(Default.notFoundHandler)<br>app.Run()</pre><p>Feel free to replace those default implementations with anything that is more suitable for your needs.</p><h4>Routing improvements</h4><p>There are two routing updates in Oxpecker 2:</p><ul><li>routef performance has slightly improved due to the reduced allocations</li><li>route group (created by GET [] or subRoute &quot;&quot; [] ) configuration performed by using configureEndpoint function (yes, you can apply it to both individual endpoints and groups) is now directly mapped as the <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-10.0#route-groups">ASP.NET Core routing group</a> configuration</li></ul><h4>ViewEngine improvements</h4><p>There are minor performance tweaks in ViewEngine, but also one usability improvement — now you can place your int numbers into the markup without first converting them to string:</p><pre>div(){<br>    &quot;You number is: &quot;<br>    123 <br>}<br>// &lt;div&gt;You number is: 123&lt;/div&gt;</pre><h3>Breaking changes</h3><ul><li><strong>Oxpecker</strong> 2 and sibling libraries are now <strong>.NET 10</strong> based. For <strong>Oxpecker.OpenApi </strong>it was a requirement; for others it was not, but since you won’t be able to use the new <strong>Oxpecker.OpenApi </strong>on <strong>.NET 8 </strong>or <strong>.NET 9</strong> anyway, and taking into account other changes, I decided to do this change sooner rather than later.</li><li><strong>CSRF protection </strong>by default is also a breaking change. If you had .UseAntiforgery enabled in your project, but didn’t validate requests, they will start failing on form binding without a proper <em>AntiforgeryToken </em>included in request.</li><li>As mentioned above, the parameters of configureOperation in the <strong>Oxpecker.OpenApi </strong>package have changed, so if you used it before — you’ll need to update the code to conform to the new type signature.</li></ul><h3>Non-breaking changes</h3><ul><li>The applyBefore helper function has been deprecated in favor of the new addFilter function. I think the new name reads better in most common use cases and matches .AddEndpointFilter from <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/min-api-filters">Minimal APIs</a></li><li>The applyAfter helper function has been deprecated and will be just removed in the next release. This handler was initially ported from Giraffe as is, but later I realized that it doesn’t fit Oxpecker’s model well.</li><li>The htmlString handler and the .WriteHtmlString extension method have been deprecated. Those functions don’t do HTML encoding, but rather are identical to returning text, just with different header. As soon as they are neither performant <a href="https://github.com/Lanayx/Oxpecker/pull/82">nor safe</a>, I decided to drop them.</li></ul><p>That concludes the <a href="https://github.com/Lanayx/Oxpecker">Oxpecker</a> 2 overview, now you are welcome to try it and give feedback! I’d like to thank all the contributors who participated in creating issues and pull requests and helped to push the project forward, as well as Sergei Tihon for his continuous effort in organizing the event every year. And looking forward to other <a href="https://sergeytihon.com/2025/11/03/f-advent-calendar-in-english-2025/">F# Advent stories</a>!☃️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbeef82249f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 practical examples of applying “lean” principles to your code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Lanayx/7-practical-examples-of-applying-lean-principles-to-software-development-12f98ade979e?source=rss-ed26b6a4aecb------2"><img src="https://cdn-images-1.medium.com/max/1792/1*-dbKHlAXQ8nvvggqftLTHQ.png" width="1792"></a></p><p class="medium-feed-snippet">Technical view on software project design</p><p class="medium-feed-link"><a href="https://medium.com/@Lanayx/7-practical-examples-of-applying-lean-principles-to-software-development-12f98ade979e?source=rss-ed26b6a4aecb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Lanayx/7-practical-examples-of-applying-lean-principles-to-software-development-12f98ade979e?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/12f98ade979e</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[lean]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 22:39:42 GMT</pubDate>
            <atom:updated>2025-12-04T02:02:02.057Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Growing custom Agile "framework"]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analysts-corner/growing-custom-agile-framework-cc11e681a219?source=rss-ed26b6a4aecb------2"><img src="https://cdn-images-1.medium.com/max/1792/1*zeihjiUjVSMOMDN9THMX-Q.png" width="1792"></a></p><p class="medium-feed-snippet">Without weeds</p><p class="medium-feed-link"><a href="https://medium.com/analysts-corner/growing-custom-agile-framework-cc11e681a219?source=rss-ed26b6a4aecb------2">Continue reading on Analyst’s corner »</a></p></div>]]></description>
            <link>https://medium.com/analysts-corner/growing-custom-agile-framework-cc11e681a219?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc11e681a219</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[safe-framework]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Tue, 14 Oct 2025 04:39:26 GMT</pubDate>
            <atom:updated>2025-10-30T21:50:54.943Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Are agile frameworks really Agile?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/analysts-corner/are-agile-frameworks-really-agile-edf0a7406207?source=rss-ed26b6a4aecb------2"><img src="https://cdn-images-1.medium.com/max/1231/1*U5oW9MButTIr-YhdZufzOw.png" width="1231"></a></p><p class="medium-feed-snippet">Or it&apos;s all just marketing?</p><p class="medium-feed-link"><a href="https://medium.com/analysts-corner/are-agile-frameworks-really-agile-edf0a7406207?source=rss-ed26b6a4aecb------2">Continue reading on Analyst’s corner »</a></p></div>]]></description>
            <link>https://medium.com/analysts-corner/are-agile-frameworks-really-agile-edf0a7406207?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/edf0a7406207</guid>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[safe-framework]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Tue, 14 Oct 2025 04:37:43 GMT</pubDate>
            <atom:updated>2025-10-25T05:29:26.763Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Is SOLID still a solid choice for software design?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@Lanayx/is-solid-still-a-solid-choice-for-software-design-512567eda431?source=rss-ed26b6a4aecb------2"><img src="https://cdn-images-1.medium.com/max/1207/1*Nd4qtzRhSZdk7ozythyefA.png" width="1207"></a></p><p class="medium-feed-snippet">Exploring SOLID</p><p class="medium-feed-link"><a href="https://medium.com/@Lanayx/is-solid-still-a-solid-choice-for-software-design-512567eda431?source=rss-ed26b6a4aecb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@Lanayx/is-solid-still-a-solid-choice-for-software-design-512567eda431?source=rss-ed26b6a4aecb------2</link>
            <guid isPermaLink="false">https://medium.com/p/512567eda431</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Vladimir Shchur]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 23:19:49 GMT</pubDate>
            <atom:updated>2025-10-06T05:42:10.913Z</atom:updated>
        </item>
    </channel>
</rss>