Skip to content

Feat: add support for "type": "file" in parameters #766

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

Merged
merged 1 commit into from
Sep 30, 2021
Merged

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Sep 30, 2021

Related to #726. When type: "file" is encountered in parameters, weird results occur.

@@ -67,6 +77,11 @@ export function nodeType(obj: any): SchemaObjectType | undefined {
return "array";
}

// file
if (obj.type === "file") {
return "unknown";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

At least for now, we’ll return unknown for a file type. Because we’re not sure where this is running—server or browser—it would seem risky to simply assume a Buffer or string type for a file. Instead, we’ll rely on the implementer to specify how to deal with the file.

@codecov
Copy link

codecov bot commented Sep 30, 2021

Codecov Report

Merging #766 (b3095fe) into main (56cc872) will decrease coverage by 2.18%.
The diff coverage is 52.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #766      +/-   ##
==========================================
- Coverage   96.34%   94.15%   -2.19%     
==========================================
  Files          13       13              
  Lines         547      565      +18     
  Branches      194      197       +3     
==========================================
+ Hits          527      532       +5     
- Misses         19       32      +13     
  Partials        1        1              
Impacted Files Coverage Δ
src/load.ts 82.50% <33.33%> (-8.93%) ⬇️
src/index.ts 96.66% <100.00%> (ø)
src/transform/schema.ts 99.00% <100.00%> (+0.01%) ⬆️
src/utils.ts 95.00% <100.00%> (-1.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a266be...b3095fe. Read the comment docs.

@drwpow drwpow merged commit cec2bdf into main Sep 30, 2021
@drwpow drwpow deleted the feat-type-file branch September 30, 2021 21:07
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.

1 participant