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

Add support for uploading a Stainless config file in addition to the OpenAPI spec file #9

Conversation

dgellow
Copy link
Member

@dgellow dgellow commented Nov 21, 2023

This pull request does three main changes:

  1. The endpoint POST /api/spec has been updated to support a multipart/form-data body, making it possible to provide both the spec file and a Stainless config file. When the new input config_path is provided both the spec and config files will be uploaded, otherwise only the spec file will be uploaded.
  2. While still supported, the use of S3 pre-signed URLs isn't required anymore. I removed that logic, the github action now relies on a single request POST /api/spec instead of the previous 3-steps dance.

Also, use direct upload instead of S3 presigned URLs.
action.yml Outdated Show resolved Hide resolved
index.ts Outdated Show resolved Hide resolved
index.ts Outdated Show resolved Hide resolved
@dgellow
Copy link
Member Author

dgellow commented Nov 25, 2023

Tested this branch via a GitHub workflow, it works but we get a deprecation warning:

Run stainless-api/upload-openapi-spec-action@sam/sta-2798-update-upload-github-action-to-support-a-stainless-config-in
  with:
    stainless_api_key: ***
    input_path: specs/sink-openapi.yml
Uploading spec and config files...
(node:1383) [https://github.com/node-fetch/node-fetch/issues/1167] DeprecationWarning: form-data doesn't follow the spec and requires special treatment. Use alternative package
(Use `node --trace-deprecation ...` to show where the warning was created)

I will look into it.

@dgellow dgellow merged commit 2c68462 into main Nov 28, 2023
2 checks passed
@dgellow dgellow deleted the sam/sta-2798-update-upload-github-action-to-support-a-stainless-config-in branch November 28, 2023 03:39
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