Description
Currently, naming conventions endpoints and JSON keys for different collection types are slightly inconsistent when it comes to plural of the collection object (images, csvs, datas). To demonstrate the issue, take a look at the table below:
| Collection type |
API endpoint |
Collection element endpoint |
JSON key containing elements of collection |
| Image Collections |
/api/imagesCollections |
/api/imagesCollections/{imagesCollectionId}/images |
_embedded -> images |
| CSV Collections |
/api/csvCollections |
/api/csvCollections/{csvCollectionId}/csv |
_embedded -> csvs |
| Generic Data Collections |
/api/genericDatas |
/api/genericDatas/{genericDataId}/genericFile |
_embedded -> genericFiles |
So, you can see that the same word images is used in both the endpoint and JSON key in this case, but different words (csv and csvs, genericFile and genericFiles) are used in other cases.
Proposal
Use the plural form for objects; use the same form in all places in the API. The following naming scheme would be more consistent:
| Collection type |
API endpoint |
Collection element endpoint |
JSON key containing elements of collection |
| Image Collections |
/api/imagesCollections |
/api/imagesCollections/{imagesCollectionId}/images |
_embedded -> images |
| CSV Collections |
/api/csvCollections |
/api/csvCollections/{csvCollectionId}/csvs |
_embedded -> csvs |
| Generic Data Collections |
/api/genericDataCollections |
/api/genericDatas/{genericDataId}/genericFiles |
_embedded -> genericFiles |
Description
Currently, naming conventions endpoints and JSON keys for different collection types are slightly inconsistent when it comes to plural of the collection object (images, csvs, datas). To demonstrate the issue, take a look at the table below:
/api/imagesCollections/api/imagesCollections/{imagesCollectionId}/images_embedded->images/api/csvCollections/api/csvCollections/{csvCollectionId}/csv_embedded->csvs/api/genericDatas/api/genericDatas/{genericDataId}/genericFile_embedded->genericFilesSo, you can see that the same word
imagesis used in both the endpoint and JSON key in this case, but different words (csvandcsvs,genericFileandgenericFiles) are used in other cases.Proposal
Use the plural form for objects; use the same form in all places in the API. The following naming scheme would be more consistent:
/api/imagesCollections/api/imagesCollections/{imagesCollectionId}/images_embedded->images/api/csvCollections/api/csvCollections/{csvCollectionId}/csvs_embedded->csvs/api/genericDataCollections/api/genericDatas/{genericDataId}/genericFiles_embedded->genericFiles