-
Notifications
You must be signed in to change notification settings - Fork 2
Allows specifying default specification via config #558
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
Conversation
The default specification is the one displayed when no specification has been selected via the URL or when the project is opened from the sidebar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a default specification feature that lets users specify which OpenAPI specification is used by default via the config key "defaultSpecificationName". The key changes include using the "isDefault" flag when selecting specifications in various components, extending the OpenApiSpecification schema to include "isDefault", and adding tests to validate the correct default specification behavior.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/features/projects/domain/getProjectSelectionFromPath.ts | Uses "isDefault" flag when choosing a specification from a version. |
| src/features/projects/domain/ProjectNavigator.ts | Uses "isDefault" flag to navigate to the default specification. |
| src/features/projects/domain/OpenApiSpecification.ts | Extends the schema with the "isDefault" boolean field. |
| src/features/projects/domain/IProjectConfig.ts | Adds the "defaultSpecificationName" configurable property. |
| src/features/projects/data/useProjectSelection.ts | Updates specification selection using the "isDefault" flag. |
| src/features/projects/data/GitHubProjectDataSource.ts | Maps default specification from config and initializes "isDefault". |
| test/projects/GitHubProjectDataSource.test.ts | Adds tests validating the default specification logic. |
Comments suppressed due to low confidence (1)
test/projects/GitHubProjectDataSource.test.ts:955
- [nitpick] There appears to be inconsistent naming between 'configYml' and 'configYaml' across tests. Consider standardizing the configuration property name to improve clarity.
configYml: { text: `\n defaultSpecificationName: bar-service.yml\n remoteVersions:
Co-authored-by: Copilot <[email protected]>
The default specification is the one displayed when no specification has been selected via the URL or when the project is opened from the sidebar.
Co-authored-by: Copilot <[email protected]>
ca487b2 to
6af91b5
Compare
…aultSpecification # Conflicts: # src/features/projects/data/useProjectSelection.ts # src/features/projects/domain/ProjectNavigator.ts # src/features/projects/domain/getProjectSelectionFromPath.ts
|
This seems like a great idea! I've opened #564 which suggest introducing a |
Introduce getDefaultSpecification for #558
Nice! |
simonbs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
This PR allows specifying default specification via config key
defaultSpecificationName.Motivation and Context
When multiple specifications exist in a repository (project) it is useful to be able to specify which one should be displayed per default.
The default specification is the one displayed when no specification has been selected via the URL or when the project is opened from the sidebar.
It can be either a filename in the repository or the name of a specification in a remote version.
Screenshots (if appropriate):
Types of changes