Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0] Fix optional types in Help Forum API #17832

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 36 additions & 17 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6656,19 +6656,38 @@ export interface components {
* This model is based on the Discourse API response for the search endpoint.
*/
HelpForumSearchResponse: {
/** Categories */
categories: components["schemas"]["HelpForumCategory"][] | null;
grouped_search_result: components["schemas"]["HelpForumGroupedSearchResult"] | null;
/** Groups */
groups: components["schemas"]["HelpForumGroup"][] | null;
/** Posts */
posts: components["schemas"]["HelpForumPost"][] | null;
/** Tags */
tags: components["schemas"]["HelpForumTag"][] | null;
/** Topics */
topics: components["schemas"]["HelpForumTopic"][] | null;
/** Users */
users: components["schemas"]["HelpForumUser"][] | null;
/**
* Categories
* @description The list of categories returned by the search.
*/
categories?: components["schemas"]["HelpForumCategory"][] | null;
/** @description The grouped search result. */
grouped_search_result?: components["schemas"]["HelpForumGroupedSearchResult"] | null;
/**
* Groups
* @description The list of groups returned by the search.
*/
groups?: components["schemas"]["HelpForumGroup"][] | null;
/**
* Posts
* @description The list of posts returned by the search.
*/
posts?: components["schemas"]["HelpForumPost"][];
/**
* Tags
* @description The list of tags returned by the search.
*/
tags?: components["schemas"]["HelpForumTag"][] | null;
/**
* Topics
* @description The list of topics returned by the search.
*/
topics?: components["schemas"]["HelpForumTopic"][];
/**
* Users
* @description The list of users returned by the search.
*/
users?: components["schemas"]["HelpForumUser"][] | null;
};
/**
* HelpForumTag
Expand Down Expand Up @@ -6696,7 +6715,7 @@ export interface components {
* Bookmarked
* @description Whether the topic is bookmarked.
*/
bookmarked: boolean | null;
bookmarked?: boolean | null;
/**
* Bumped
* @description Whether the topic was bumped.
Expand Down Expand Up @@ -6751,7 +6770,7 @@ export interface components {
* Liked
* @description Whether the topic is liked.
*/
liked: boolean | null;
liked?: boolean | null;
/**
* Pinned
* @description Whether the topic is pinned.
Expand Down Expand Up @@ -6781,7 +6800,7 @@ export interface components {
* Tags Descriptions
* @description The descriptions of the tags of the topic.
*/
tags_descriptions: Record<string, never> | null;
tags_descriptions?: Record<string, never> | null;
/**
* Title
* @description The title of the topic.
Expand All @@ -6791,7 +6810,7 @@ export interface components {
* Unpinned
* @description Whether the topic is unpinned.
*/
unpinned: boolean | null;
unpinned?: boolean | null;
/**
* Unseen
* @description Whether the topic is unseen.
Expand Down
37 changes: 26 additions & 11 deletions lib/galaxy/schema/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ class HelpForumTopic(Model):
archetype: Annotated[Any, Field(description="The archetype of the topic.")]
unseen: Annotated[bool, Field(description="Whether the topic is unseen.")]
pinned: Annotated[bool, Field(description="Whether the topic is pinned.")]
unpinned: Annotated[Optional[bool], Field(description="Whether the topic is unpinned.")]
unpinned: Annotated[Optional[bool], Field(default=None, description="Whether the topic is unpinned.")]
visible: Annotated[bool, Field(description="Whether the topic is visible.")]
closed: Annotated[bool, Field(description="Whether the topic is closed.")]
archived: Annotated[bool, Field(description="Whether the topic is archived.")]
bookmarked: Annotated[Optional[bool], Field(description="Whether the topic is bookmarked.")]
liked: Annotated[Optional[bool], Field(description="Whether the topic is liked.")]
bookmarked: Annotated[Optional[bool], Field(default=None, description="Whether the topic is bookmarked.")]
liked: Annotated[Optional[bool], Field(default=None, description="Whether the topic is liked.")]
tags: Annotated[List[str], Field(description="The tags of the topic.")]
tags_descriptions: Annotated[Optional[Any], Field(description="The descriptions of the tags of the topic.")]
tags_descriptions: Annotated[
Optional[Any], Field(default=None, description="The descriptions of the tags of the topic.")
]
category_id: Annotated[int, Field(description="The ID of the category of the topic.")]
has_accepted_answer: Annotated[bool, Field(description="Whether the topic has an accepted answer.")]

Expand Down Expand Up @@ -102,10 +104,23 @@ class HelpForumSearchResponse(Model):
This model is based on the Discourse API response for the search endpoint.
"""

posts: Optional[List[HelpForumPost]]
topics: Optional[List[HelpForumTopic]]
users: Optional[List[HelpForumUser]]
categories: Optional[List[HelpForumCategory]]
tags: Optional[List[HelpForumTag]]
groups: Optional[List[HelpForumGroup]]
grouped_search_result: Optional[HelpForumGroupedSearchResult]
posts: Annotated[List[HelpForumPost], Field(default=None, description="The list of posts returned by the search.")]
topics: Annotated[
List[HelpForumTopic], Field(default=None, description="The list of topics returned by the search.")
]
users: Annotated[
Optional[List[HelpForumUser]], Field(default=None, description="The list of users returned by the search.")
]
categories: Annotated[
Optional[List[HelpForumCategory]],
Field(default=None, description="The list of categories returned by the search."),
]
tags: Annotated[
Optional[List[HelpForumTag]], Field(default=None, description="The list of tags returned by the search.")
]
groups: Annotated[
Optional[List[HelpForumGroup]], Field(default=None, description="The list of groups returned by the search.")
]
grouped_search_result: Annotated[
Optional[HelpForumGroupedSearchResult], Field(default=None, description="The grouped search result.")
]
Loading