From cc8d3318c073dc48847d133acebea850021cd4b9 Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:48:29 -0700 Subject: [PATCH] add disclosures to v2 search + docs --- apps/docs/public/openapi.yaml | 54 ++++++++++++++++++- apps/labrinth/src/models/v2/search.rs | 2 + .../api-client/src/modules/labrinth/types.ts | 2 + 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/apps/docs/public/openapi.yaml b/apps/docs/public/openapi.yaml index db44ff83d6..9407d9ac28 100644 --- a/apps/docs/public/openapi.yaml +++ b/apps/docs/public/openapi.yaml @@ -429,6 +429,25 @@ components: - unknown example: client_and_server description: 'The environment a project or version supports. For an explanation of each environment, see the blog post here: https://modrinth.com/news/article/new-environments/#new-system' + DisclosureTypeEnum: + type: string + enum: + - ai_content + - ai_content_code + - ai_content_assets + - ai_content_text + - ai_content_functionality + - advertisements + - epilepsy_triggers + - system_interactions + - telemetry + - telemetry_opt_in + - telemetry_opt_out + - telemetry_always_active + - derivative_work + - paid_features + - archived + example: ai_content_code EnvironmentInputEnum: type: string enum: @@ -727,6 +746,12 @@ components: $ref: '#/components/schemas/EnvironmentEnum' description: 'All the environments that versions of this project support. Not in any particular order, we recommend using the environment information on a version instead. For an explanation of each environment, see the blog post here: https://modrinth.com/news/article/new-environments/#new-system' example: [client_and_server] + disclosure_types: + type: array + items: + $ref: '#/components/schemas/DisclosureTypeEnum' + description: Disclosures listed on the project. + example: [ai_content, ai_content_code, advertisements] gallery: type: array description: A list of images that have been uploaded to the project's gallery @@ -796,6 +821,7 @@ components: - latest_version - license - environment + - disclosure_types - gallery - client_side - server_side @@ -2160,7 +2186,33 @@ paths: - `categories` (loaders are lumped in with categories in search) - `versions` - `open_source` - - `environment` + - `environment` (one of the following values) + - `client_and_server` + - `client_only` + - `client_only_server_optional` + - `singleplayer_only` + - `server_only` + - `server_only_client_optional` + - `dedicated_server_only` + - `client_or_server` + - `client_or_server_prefers_both` + - `unknown` + - `disclosure_types` (list of any of the following values) + - `ai_content` + - `ai_content_code` + - `ai_content_assets` + - `ai_content_text` + - `ai_content_functionality` + - `advertisements` + - `epilepsy_triggers` + - `system_interactions` + - `telemetry` + - `telemetry_opt_in` + - `telemetry_opt_out` + - `telemetry_always_active` + - `derivative_work` + - `paid_features` + - `archived` - `client_side` (deprecated - use `environment` instead) - `server_side` (deprecated - use `environment` instead) diff --git a/apps/labrinth/src/models/v2/search.rs b/apps/labrinth/src/models/v2/search.rs index 2edfef56fe..17bbb0fa8e 100644 --- a/apps/labrinth/src/models/v2/search.rs +++ b/apps/labrinth/src/models/v2/search.rs @@ -42,6 +42,7 @@ pub struct LegacyResultSearchProject { pub client_side: String, pub server_side: String, pub environment: Vec, + pub disclosure_types: Vec, pub gallery: Vec, pub featured_gallery: Option, pub color: Option, @@ -151,6 +152,7 @@ impl LegacyResultSearchProject { client_side, server_side, environment: environments, + disclosure_types: result_search_project.disclosure_types, versions, latest_version: result_search_project .version_id diff --git a/packages/api-client/src/modules/labrinth/types.ts b/packages/api-client/src/modules/labrinth/types.ts index d127526687..81928d0686 100644 --- a/packages/api-client/src/modules/labrinth/types.ts +++ b/packages/api-client/src/modules/labrinth/types.ts @@ -1884,6 +1884,7 @@ export namespace Labrinth { license: string client_side: string server_side: string + disclosure_types: string[] gallery: string[] featured_gallery: string | null color: number | null @@ -1929,6 +1930,7 @@ export namespace Labrinth { minecraft_java_server?: Projects.v3.MinecraftJavaServer | null minecraft_bedrock_server?: Projects.v3.MinecraftBedrockServer | null minecraft_mod?: unknown | null + disclosure_types: string[] } export interface SearchResults {