
Hej!
That's right... I was at IKEA at the weekend where I picked up a fresh supply of SYLT LINGON, (Lingonberry jam to you and I). Or simply "jam".
And.
A.
Few.
Other.
Bits and bobs I didn't know I needed. Don't you just love a good ol' mooch around IKEA?
Since casting aside my big yellow sack at the weekend, it's been all go: Monday was my first day back after a fortnight break. The break was pleasant, of course, but I can genuinely say it was good to get back to my project.
This week I've been working up some JSON schemas ahead of integration work I will be doing. I don't know about you but I've found JSON schema to be super useful. A JSON schema...
- is cheap, easy and quick to produce - tick
- is easy to share - tick
- is easy to reason about - semi-tick
- can drive your payload validation - TICK
- will enable both API developer and API consumer to test payloads before either write a single line of application code - MEGA-HELL-YEH-TICK
A particular aspect of JSON schema I've been reminded about this week is conditional schema validation: For cases when you have a resource, that under certain conditions, has additional properties. One might argue in certain scenarios such as this, you've actually got two distinct resources, and maybe that's right in some cases. Anyways, in my JSON schema, I was able to express that if the value of a property on the resource was of a specific value, the payload must include two additional properties and that in all other cases, those properties should not be sent. Trevlig!
I was also working with JSON Web Token. Having installed, and played with, the Drupal JWT contributed module, I quickly realised that it doesn't support refresh tokens, so I've added that functionality. There's actually a two year old open issue, so I'm hoping to find some time to contribute the code I've written back into the project for other people to use.
I also worked a little bit more on the Drupal contributed Mastodon API module, simple fix here, in order to address a todo that I spotted in the codebase. The pull request for the todo broke a test, so I'm working on that.
Well, that'll do for now. Have a good week!
Hejdå!