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

[BUG]: new API: Duplicate links object in get one API responses #1161

Open
jessevz opened this issue Dec 17, 2024 · 0 comments
Open

[BUG]: new API: Duplicate links object in get one API responses #1161

jessevz opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working server Hashtopolis API/Server related

Comments

@jessevz
Copy link
Contributor

jessevz commented Dec 17, 2024

Version Information

0.14.3

Hashcat

No response

Description

Currently when you do a get one API call you will get the same links object twice in the response:

  1. At the top level of the response (document-level links).
  2. Inside the data object (resource-level links).

For example the GET call to: 'http://localhost:8080/api/v2/ui/crackertypes/1' will return:

{
"jsonapi": {
"version": "1.1",
"ext": [
"https://jsonapi.org/profiles/ethanresnick/cursor-pagination"
]
},
"links": {
"self": "/api/v2/ui/crackertypes/1"
},
"data": {
"type": "crackerBinaryType",
"id": 1,
"attributes": {
"typeName": "hashcat",
"isChunkingAvailable": true
},
"links": {
"self": "/api/v2/ui/crackertypes/1"
},
"relationships": {
"crackerVersions": {
"links": {
"self": "/api/v2/ui/crackertypes/1/relationships/crackerVersions",
"related": "/api/v2/ui/crackertypes/1/crackerVersions"
}
},
"tasks": {
"links": {
"self": "/api/v2/ui/crackertypes/1/relationships/tasks",
"related": "/api/v2/ui/crackertypes/1/tasks"
}
}
}
}
}

In this response you see the top level link object for the document and the link object for the specific object in the data section, which are the same. This redundancy is more useful in GET requests for multiple resources, where the document-level links differ from the resource-specific links.

My suggestion for this is to remove the links object in the data section for responses to get one API calls.

@jessevz jessevz added bug Something isn't working server Hashtopolis API/Server related labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Hashtopolis API/Server related
Projects
None yet
Development

No branches or pull requests

1 participant