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

Endpoints['GET /repos/{owner}/{repo}/git/trees/{tree_sha}'] response is too relaxed #285

Open
ojab opened this issue Mar 8, 2021 · 4 comments
Labels
Status: Blocked Blocked by GitHub's API or other external factors Type: Bug Something isn't working as documented, or is being fixed typescript Relevant to TypeScript users only

Comments

@ojab
Copy link

ojab commented Mar 8, 2021

What happened?

It returns components["schemas"]["git-tree"] which has tree field defined as

tree: {
  path?: string;
  mode?: string;
  type?: string;
  sha?: string;
  size?: number;
  url?: string;
}[];

while operations["git/create-tree"] has request params defined as

tree: {
  path?: string;
  mode?: "100644" | "100755" | "040000" | "160000" | "120000";
  type?: "blob" | "tree" | "commit";
  sha?: string | null;
  content?: string;
}[];

so response type is not compatible with request one.

What did you expect to happen?

mode & type should be compatible.

What the problem might be

mode & type on components["schemas"]["git-tree"] should be more strict.

@ojab ojab added the Type: Bug Something isn't working as documented, or is being fixed label Mar 8, 2021
@ojab ojab changed the title Endpoints['GET /repos/{owner}/{repo}/git/trees/{tree_sha}'] response mode is too relaxed Endpoints['GET /repos/{owner}/{repo}/git/trees/{tree_sha}'] response mode/type is too relaxed Mar 8, 2021
@ojab ojab changed the title Endpoints['GET /repos/{owner}/{repo}/git/trees/{tree_sha}'] response mode/type is too relaxed Endpoints['GET /repos/{owner}/{repo}/git/trees/{tree_sha}'] response is too relaxed Mar 8, 2021
@gr2m
Copy link
Contributor

gr2m commented Mar 8, 2021

As in #284, may I ask you to do me a favor and report this issue in https://github.com/github/rest-api-description, similar to e.g. github/rest-api-description#228? I can do it myself eventually but I have other priorities right now. If you could report it we would get it fixed faster

@ojab
Copy link
Author

ojab commented Mar 9, 2021

github/rest-api-description#229

@gr2m gr2m added typescript Relevant to TypeScript users only Status: Blocked Blocked by GitHub's API or other external factors labels Apr 22, 2021
@gr2m
Copy link
Contributor

gr2m commented Apr 22, 2021

Thanks @ojab. Please let us know once the problem was resolved at github/rest-api-description#229

@rpmccarter
Copy link

For folks who find this issue like I did - it's also too relaxed in the sense that path, mode, type, and sha should all be required. I created github/rest-api-description#3833 to fix this (also gave github/rest-api-description#229 a little bump 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Blocked by GitHub's API or other external factors Type: Bug Something isn't working as documented, or is being fixed typescript Relevant to TypeScript users only
Projects
None yet
Development

No branches or pull requests

3 participants