[Schema Inaccuracy] Artifact.Id is missing `int64` format
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- openapi
- Domain
- api
Research direction
Open api.github.com.json and locate the artifact object's id property. Add the int64 format shown in the issue, then verify the schema causes generated clients to use a 64-bit deserializer rather than an integer deserializer.
Written by the indexing model from the issue text.
Description
Schema Inaccuracy
When I use Kiota to generate clients for the GitHub API, I get a deserialization error when retreiving artifacts through the API. The value for the Artifact.Id is simply too large and exceeds an Int32.
Expected
It should not result in deserialization errors.
Problem
In the api.github.com.json file, the Actor.Id is defined as:
"artifact": {
"title": "Artifact",
"description": "An artifact",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 5
},
This makes Kiota belive that it can use an integer deserializer:
public virtual IDictionary<string, Action<IParseNode>> GetFieldDeserializers()
{
return new Dictionary<string, Action<IParseNode>>
{
{ "archive_download_url", n => { ArchiveDownloadUrl = n.GetStringValue(); } },
{ "created_at", n => { CreatedAt = n.GetDateTimeOffsetValue(); } },
{ "digest", n => { Digest = n.GetStringValue(); } },
{ "expired", n => { Expired = n.GetBoolValue(); } },
{ "expires_at", n => { ExpiresAt = n.GetDateTimeOffsetValue(); } },
---> { "id", n => { Id = n.GetIntValue(); } },
{ "name", n => { Name = n.GetStringValue(); } },
{ "node_id", n => { NodeId = n.GetStringValue(); } },
{ "size_in_bytes", n => { SizeInBytes = n.GetIntValue(); } },
{ "updated_at", n => { UpdatedAt = n.GetDateTimeOffsetValue(); } },
{ "url", n => { Url = n.GetStringValue(); } },
{ "workflow_run", n => { WorkflowRun = n.GetObjectValue<global::GitPackagesManager.ApiClient.Models.Artifact_workflow_run>(global::GitPackagesManager.ApiClient.Models.Artifact_workflow_run.CreateFromDiscriminatorValue); } },
};
}
If the Artifact.Id had been defined as
"artifact": {
"title": "Artifact",
"description": "An artifact",
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 5,
"format": "int64"
},
the 'Id' line in the generated GetFieldDeserializers() method would use n.GetLongValue() instead of n.GetIntValue()
- Dominant language
- No language data
- Stars
- 1.6k
- Forks
- 345
- Avg merge
- 6h
- Merged PRs (30d)
- 82
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/rest-api-description
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
github/rest-api-description#7246 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
github/rest-api-description#7220 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
github/rest-api-description#7201 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/rest-api-description#7163 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/rest-api-description#7162 ·
Maintainers usually reply within 1 day
All issues in github/rest-api-description
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MystenLabs/MemWal#1084 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug No Code Attached Yet
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
joomla/joomla-cms#48556 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelscope/FunASR#3757 ·
Maintainers usually reply within 1 day