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

feat: allow the swagger path to be configurable #1425

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

Junjiequan
Copy link
Member

@Junjiequan Junjiequan commented Sep 18, 2024

Description

This PR makes the Swagger path configurable by allowing it to be set through the SWAGGER_PATH environment variable. If not provided, it defaults to “explorer.”

Motivation

Making the Swagger path configurable improves flexibility, allowing different paths for different environments

Fixes:

Please provide a list of the fixes implemented by this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

@Junjiequan Junjiequan requested a review from nitrosx September 18, 2024 14:32
Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go, just one minor request

src/main.ts Outdated
@@ -36,8 +36,9 @@ async function bootstrap() {
docExpansion: "none",
},
};
const swaggerPath = process.env.SWAGGER_PATH || "explorer";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you place this in the config service, please?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Junjiequan Junjiequan force-pushed the SWAP-4199-scicat-be-make-swagger-url-configurable- branch from dd47a99 to 35cf081 Compare September 19, 2024 07:29
@Junjiequan Junjiequan requested a review from nitrosx September 19, 2024 08:13
Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To minor changes

src/config/configuration.ts Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
In configuration.ts, add a new property "versions.api" with a default value of "v3".
Also, add a new property "swaggerPath" with a default value of "explorer".
@Junjiequan Junjiequan force-pushed the SWAP-4199-scicat-be-make-swagger-url-configurable- branch from a611f50 to 55329e7 Compare September 19, 2024 13:16
@nitrosx nitrosx merged commit 4b4951a into master Sep 19, 2024
8 checks passed
@nitrosx nitrosx deleted the SWAP-4199-scicat-be-make-swagger-url-configurable- branch September 19, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants