smarbos / adopteitor-feathers

New Version of Adopteitor based on FeathersJS
MIT License
0 stars 0 forks source link

GET /animals/ #1

Open smarbos opened 6 years ago

smarbos commented 6 years ago

/Animals:

Current URL: http://www.adoptaungalgoenargentina.com:8080/Animal/ Original implementation

Note:

I think maybe we should rename and use plural terms for endpoints, /animals/ sound better to me. If we choose to change the URL, we must update the client also.

Tasks:

Query parameters:

Options:

{
"name": "Animal List",
"description": "API endpoint that allows groups to be viewed or edited.",
"renders": [
    "application/json",
    "text/html"
],
"parses": [
    "application/json",
    "application/x-www-form-urlencoded",
    "multipart/form-data"
],
"actions": {
    "POST": {
        "id": {
            "type": "integer",
            "required": false,
            "read_only": true,
            "label": "Id"
        },
        "nombre": {
            "type": "string",
            "required": true,
            "read_only": false,
            "label": "Nombre",
            "max_length": 255
        },
        "genero": {
            "type": "choice",
            "required": true,
            "read_only": false,
            "label": "Genero",
            "choices": [
                {
                    "display_name": "macho",
                    "value": "m"
                },
                {
                    "display_name": "hembra",
                    "value": "h"
                }
            ]
        },
        "fecha_nacimiento": {
            "type": "datetime",
            "required": true,
            "read_only": false,
            "label": "Fecha nacimiento"
        },
        "desc": {
            "type": "string",
            "required": true,
            "read_only": false,
            "label": "Desc",
            "max_length": 1024
        },
        "fotos": {
            "type": "field",
            "required": true,
            "read_only": false,
            "label": "Fotos",
            "choices": []
        },
        "fecha_ingreso": {
            "type": "datetime",
            "required": false,
            "read_only": true,
            "label": "Fecha ingreso"
        },
        "edad": {
            "type": "integer",
            "required": true,
            "read_only": false,
            "label": "Edad"
        },
        "etapa": {
            "type": "choice",
            "required": true,
            "read_only": false,
            "label": "Etapa",
            "choices": [
                {
                    "display_name": "cachorro",
                    "value": "c"
                },
                {
                    "display_name": "adulto",
                    "value": "a"
                }
            ]
        },
        "ubicacion": {
            "type": "choice",
            "required": true,
            "read_only": false,
            "label": "Ubicacion",
            "choices": [
                {
                    "display_name": "Buenos Aires",
                    "value": "buenos-aires"
                },
                {
                    "display_name": "Neuquen",
                    "value": "neuquen"
                }
            ]
        },
        "estado": {
            "type": "choice",
            "required": true,
            "read_only": false,
            "label": "Estado",
            "choices": [
                {
                    "display_name": "En adopcion",
                    "value": "1"
                },
                {
                    "display_name": "En Transito",
                    "value": "2"
                },
                {
                    "display_name": "Adoptado",
                    "value": "3"
                }
            ]
        }
    }
}

}

Returns:

The endpoint should return an array of animals

Curl:

curl --request POST \

--url http://adoptaungalgoenargentina.com:8080/Animal/

anabellaspinelli commented 6 years ago

I say yes to:

Lovely issue btw 😘