Skip to content

Commit 114a07a

Browse files
committed
Adjust info object in OpenAPI definition
1 parent ae13a52 commit 114a07a

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build](https://github.com/sonallux/spotify-web-api/workflows/Build/badge.svg)](https://github.com/sonallux/spotify-web-api/actions?query=workflow%3ABuild)
44
[![Update API documentation](https://github.com/sonallux/spotify-web-api/workflows/Update%20API%20documentation/badge.svg)](https://github.com/sonallux/spotify-web-api/actions?query=workflow%3A%22Update+API+documentation%22)
5-
[![Maven Central](https://img.shields.io/maven-central/v/de.sonallux.spotify/spotify-web-api-core.svg?label=Maven%20Central)](https://search.maven.org/artifact/de.sonallux.spotify/spotify-web-api-core)
5+
[![Maven Central](https://img.shields.io/maven-central/v/de.sonallux.spotify/spotify-web-api-parent.svg?label=Maven%20Central)](https://search.maven.org/artifact/de.sonallux.spotify/spotify-web-api-parent)
66
[![GitHub](https://img.shields.io/github/license/sonallux/spotify-web-api)](https://github.com/sonallux/spotify-web-api/blob/main/LICENSE)
77

88
This monorepo contains tools for fixing and improving the [official Spotify OpenAPI definition](https://developer.spotify.com/_data/documentation/web-api/reference/open-api-schema.yml).

fixed-spotify-open-api.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ info:
88
The base URI for all Web API requests is `https://api.spotify.com/v1`.
99
1010
Need help? See our <a href="https://developer.spotify.com/documentation/web-api/guides/">Web API guides</a> for more information, or visit the <a href="https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer">Spotify for Developers community forum</a> to ask questions and connect with other developers.
11-
version: 1.0.0
12-
title: Spotify Web API
11+
version: 2021.10.17
12+
title: Spotify Web API with fixes and improvements from sonallux
1313
termsOfService: https://developer.spotify.com/terms/
14+
contact:
15+
name: sonallux
16+
url: https://github.com/sonallux/spotify-web-api
1417
servers:
1518
- url: https://api.spotify.com/v1
1619
paths:

spotify-web-api-open-api/src/main/java/de/sonallux/spotify/openapi/CLI.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.fasterxml.jackson.databind.JsonNode;
44
import com.fasterxml.jackson.databind.ObjectMapper;
5+
import com.fasterxml.jackson.databind.node.ObjectNode;
56
import com.networknt.schema.JsonSchemaFactory;
67
import com.networknt.schema.SpecVersionDetector;
78
import io.swagger.v3.core.util.Yaml;
@@ -41,6 +42,13 @@ public void run() {
4142

4243
var fixedOfficialOpenApi = applyPatches(officialOpenApi);
4344

45+
var infoNode = (ObjectNode)fixedOfficialOpenApi.get("info");
46+
infoNode.put("version", VersionProvider.getVersion());
47+
infoNode.put("title", "Spotify Web API with fixes and improvements from sonallux");
48+
infoNode.set("contact", OPEN_API_YAML.createObjectNode()
49+
.put("name", "sonallux")
50+
.put("url", "https://github.com/sonallux/spotify-web-api"));
51+
4452
if (shouldValidate) {
4553
validateOpenAPI(fixedOfficialOpenApi);
4654
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.sonallux.spotify.generator.openapi;
1+
package de.sonallux.spotify.openapi;
22

33
import java.io.IOException;
44
import java.nio.file.Files;

0 commit comments

Comments
 (0)