From 8a1527a1be9ec70aad23f156a6d5726f6648c8b6 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 11 Apr 2026 16:58:38 +0200 Subject: [PATCH] openapi-generator-cli: use more idiomatic formats.json instead of toFile/toJSON This also avoids toFile running at eval time. --- pkgs/by-name/op/openapi-generator-cli/example.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/op/openapi-generator-cli/example.nix b/pkgs/by-name/op/openapi-generator-cli/example.nix index df085b9338d9..44e15d9742e0 100644 --- a/pkgs/by-name/op/openapi-generator-cli/example.nix +++ b/pkgs/by-name/op/openapi-generator-cli/example.nix @@ -2,6 +2,7 @@ openapi-generator-cli, fetchurl, runCommand, + formats, }: runCommand "openapi-generator-cli-test" @@ -11,12 +12,10 @@ runCommand "openapi-generator-cli-test" url = "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/14c0908becbccd78252be49bd92be8c53cd2b9e3/examples/v3.0/petstore.yaml"; hash = "sha256-q2D1naR41KwxLNn6vMbL0G+Pl1q4oaDCApsqQfZf7dU="; }; - config = builtins.toFile "config.json" ( - builtins.toJSON { - elmVersion = "0.19"; - elmPrefixCustomTypeVariants = false; - } - ); + config = (formats.json { }).generate "config.json" { + elmVersion = "0.19"; + elmPrefixCustomTypeVariants = false; + }; } '' openapi-generator-cli generate \