Getting into Elixir again

A few years ago I started a project using Elixir. I loved working with it. But my motivation for the project fell and I moved onto other things.

Fast forward to this year. I started the project back up from with a different perspective. This time, I started focusing on analyzing OpenAPI schemas by looking at all the possible variations—what I talked about as schema entropy. I spent a morning writing a prototype in Python and got some interesting results.

Instead of sticking with Python for building something beyond the POC, I decided to give Elixir another try this week. I forgot how much I enjoyed it. And I’m afraid to say this—I’ve been a Lisp fan for a long time and I’m enjoying Elixir more.

The docs are great. The error reporting is nice. The pattern matching has already spoiled me. The standard library is packed with good stuff. And the functional aspect of the language makes for a nice separation between data and applying functions to the data.

Analyzing OpenAPI schemas

As I’m working with OpenAPI, I’m thankful of the approach I started with where I parse OpenAPI into my own internal structure. I’ve been burned by working directly with OpenAPI in the past and have worked on much more complex projects for modeling OpenAPI.

For this project, I kept it as simple as possible. The core of my application uses my structure for analysis while a parsing module handles the OpenAPI schema.

It was clear in the beginning how it helped, but it really showed its value when I started parsing all the OpenAPI 3 docs I could find in the OpenAPI Directory. I encountered so many edge cases. And when I did, I fixed them in my parsing layer, and once I did, the core code worked just fine.

I hope to be able to generate reports for OpenAPI schemas in the coming weeks. I’m looking at the variations of schemas now, and it’s been interesting.

I will say, circular references are frustrating. I’m still fighting one OpenAPI document that has level after level of circular refs that I’m probably going to have to visualize in order to figure it out.

Notes

  • My wife harvested a portion of her blackberries. They’re so good. Just thinking about them makes my jaw hurt.
  • I’m taking off almost three weeks starting this coming Wednesday. I can’t wait.
  • I restarted my Morning Pages habit recently and have gotten back to being consistent this week. I’ll write about this more later.
  • We started brewing our coffee this week in a French press after my wife surprised me with a subscription to get coffee grounds mailed to us monthly.
  • We watched S2 of I Think You Should Leave. It’s… um… funny? Weird? Unlike anything I’ve watched? It’s hard to put into words what feelings it invokes. It’s next level randomness.
  • We restarted watching Loki. I had a tough time getting into it at first, but the last couple of episodes have really picked up. It’s been good.
  • My writing has slowed this last week even though I posted something. It may slow down more as I’m on vacation. We’ll see.