From 1dc734609edf01d932c57fc66c037ef953a6f0f9 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Tue, 15 Apr 2025 16:43:03 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Reference=20swapi.info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces swapi.dev with swapi.info references (stable + maintained API). Tweaks README to use sentence-based line breaks. --- README.md | 17 +++++++++-------- src/main.tsp | 4 ++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 673f389..1d5815c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # SWAPI TypeSpec -[TypeSpec][typespec] representation of [SWAPI: The Star Wars API][swapi]. +[TypeSpec][typespec] representation of SWAPI: The Star Wars API. -[swapi]: https://swapi.dev +🎉 Shout out to [swapi.info][swapi] for hosting a stable version of the API. 🎉 + +[swapi]: https://swapi.info [typespec]: https://microsoft.github.io/typespec/ @@ -21,13 +23,12 @@ I created this project to learn about TypeSpec through first-hand usage. -The generated Open API 3 specification has 878 lines (with no blank lines) in a -single file. The TypeSpec source has 493 lines (about ⅓ are blank lines for -readability) split across 8 files for logical organization, which is a ~45% -reduction in lines of code. +The generated Open API 3 specification has 878 lines (with no blank lines) in a single file. +The TypeSpec source has 493 lines (about ⅓ are blank lines for readability) split across 8 files for logical organization. +This is a ~45% reduction in lines of code. -If we ignore the imports, using statements, and blank lines within models, then -the TypeSpec only has 353 lines. That means a 60% reduction in code to maintain. +If we ignore the imports, using statements, and blank lines within models, then the TypeSpec only has 353 lines. +That means a 60% reduction in code to maintain. ## Installation diff --git a/src/main.tsp b/src/main.tsp index c565b32..892182a 100644 --- a/src/main.tsp +++ b/src/main.tsp @@ -16,8 +16,8 @@ using Versioning; /** SWAPI: The Star Wars API (generated with TypeSpec from [swapi-typespec](https://github.com/connorjs/swapi-typespec#readme)). */ @service(#{ title: "SWAPI (TypeSpec)" }) -@server("https://swapi.dev/api/", "SWAPI server") -@externalDocs("https://swapi.dev/") +@server("https://swapi.info/api/", "SWAPI server") +@externalDocs("https://swapi.info/") @versioned(Version) namespace SWAPI;