add bonus 7 ex
This commit is contained in:
@@ -34,7 +34,17 @@ app.MapGet("/pokemons/{id}", (int id) =>
|
||||
}
|
||||
});
|
||||
|
||||
//METHOD GET TYPE BONUS
|
||||
app.MapGet("/pokemons/type/{type}", (string type) =>
|
||||
{
|
||||
var filterPokemons = pokemons.Where(p => p.Type.Equals(type, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
if (filterPokemons.Count == 0)
|
||||
{
|
||||
return Results.NotFound();
|
||||
}
|
||||
|
||||
return Results.Ok(filterPokemons);
|
||||
});
|
||||
|
||||
// METHOD POST
|
||||
app.MapPost("/pokemons", (PokemonInput input) =>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("PokedexApi")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+019af97404d173fdc3bef3237de8bad80c5bd6d3")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+035ec8415ccd07be9a50174b529b1ed9564ab223")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("PokedexApi")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("PokedexApi")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
f6bdaf3e11ced555b5285ac085bac99850ddf34177f4b98ac9b27690db6dab01
|
||||
7b4fd6165c5bb2842ec6f888b39503449dca9918f1adf26b1df079fd2ac4cceb
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
{"GlobalPropertiesHash":"EK2vY8wYowaVmf4SuzHxiOn1hXi2rvpnhNctScRh0Jo=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["7l6ZntsG6qFAFaYAc6Ac0xmXgWyM8PK4t6GCThnyZdk=","zZhNj3VM\u002BAKI4fgOoleIWz6nFHLWFs\u002BNMFxj\u002B\u002BHKzh8=","7jvFx9WS6iHq\u002BjZWNNFKGdTH2XqUH6GAsP3KdXJa9q4=","6\u002ByzzcjfhFu2BTVcyQU6h9XqmCB39565faOI5/ywiwc=","VNpTG6HH8gB/6UXEuy31ECgeSh1EBS4GT3Rf8OVBo5s="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
{"GlobalPropertiesHash":"EK2vY8wYowaVmf4SuzHxiOn1hXi2rvpnhNctScRh0Jo=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["7l6ZntsG6qFAFaYAc6Ac0xmXgWyM8PK4t6GCThnyZdk=","zZhNj3VM\u002BAKI4fgOoleIWz6nFHLWFs\u002BNMFxj\u002B\u002BHKzh8=","7jvFx9WS6iHq\u002BjZWNNFKGdTH2XqUH6GAsP3KdXJa9q4=","6\u002ByzzcjfhFu2BTVcyQU6h9XqmCB39565faOI5/ywiwc=","Jmd9YYf0WYN5LgvGOLY38zV/wxkl4htiU/Jp5kVSvxs="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
@@ -1 +1 @@
|
||||
{"GlobalPropertiesHash":"jCNtrNifhtXv+DhMzj5EmzYxnQ667PrKJmR2AdJlZA8=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["7l6ZntsG6qFAFaYAc6Ac0xmXgWyM8PK4t6GCThnyZdk=","zZhNj3VM\u002BAKI4fgOoleIWz6nFHLWFs\u002BNMFxj\u002B\u002BHKzh8=","7jvFx9WS6iHq\u002BjZWNNFKGdTH2XqUH6GAsP3KdXJa9q4=","6\u002ByzzcjfhFu2BTVcyQU6h9XqmCB39565faOI5/ywiwc=","VNpTG6HH8gB/6UXEuy31ECgeSh1EBS4GT3Rf8OVBo5s="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
{"GlobalPropertiesHash":"jCNtrNifhtXv+DhMzj5EmzYxnQ667PrKJmR2AdJlZA8=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["7l6ZntsG6qFAFaYAc6Ac0xmXgWyM8PK4t6GCThnyZdk=","zZhNj3VM\u002BAKI4fgOoleIWz6nFHLWFs\u002BNMFxj\u002B\u002BHKzh8=","7jvFx9WS6iHq\u002BjZWNNFKGdTH2XqUH6GAsP3KdXJa9q4=","6\u002ByzzcjfhFu2BTVcyQU6h9XqmCB39565faOI5/ywiwc=","Jmd9YYf0WYN5LgvGOLY38zV/wxkl4htiU/Jp5kVSvxs="],"CachedAssets":{},"CachedCopyCandidates":{}}
|
||||
@@ -7,11 +7,7 @@ info:
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: "{{baseUrl}}/pokemons/:id"
|
||||
params:
|
||||
- name: id
|
||||
value: ""
|
||||
type: path
|
||||
url: "{{local}}/pokemons/1"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
info:
|
||||
name: get /pokemons/type/:type
|
||||
type: http
|
||||
seq: 5
|
||||
tags:
|
||||
- PokedexApi
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: "{{local}}/pokemons/type/"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
forwardAuthorizationHeader: false
|
||||
|
||||
examples:
|
||||
- name: 200 Response
|
||||
description: OK
|
||||
request:
|
||||
url: "{{baseUrl}}/pokemons/type/:type"
|
||||
method: GET
|
||||
params:
|
||||
- name: type
|
||||
value: ""
|
||||
type: path
|
||||
response:
|
||||
status: 200
|
||||
statusText: OK
|
||||
body:
|
||||
type: text
|
||||
data: ""
|
||||
@@ -7,14 +7,14 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseUrl}}/pokemons"
|
||||
url: "{{local}}/pokemons"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"name": "",
|
||||
"type": "",
|
||||
"level": ""
|
||||
"name": "Bulbasavr",
|
||||
"type": "Grass",
|
||||
"level": "6"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
|
||||
@@ -2,9 +2,27 @@ opencollection: 1.0.0
|
||||
|
||||
info:
|
||||
name: PokedexApi | v1
|
||||
config:
|
||||
proxy:
|
||||
inherit: true
|
||||
config:
|
||||
protocol: http
|
||||
hostname: ""
|
||||
port: ""
|
||||
auth:
|
||||
username: ""
|
||||
password: ""
|
||||
bypassProxy: ""
|
||||
bundled: false
|
||||
extensions:
|
||||
bruno:
|
||||
ignore:
|
||||
- node_modules
|
||||
- .git
|
||||
openapi:
|
||||
- sourceUrl: http://localhost:5166/openapi/v1.json
|
||||
groupBy: tags
|
||||
lastSyncDate: 2026-10-16T10:22:56.163Z
|
||||
specHash: fa61f3f539edbf73e080ee252a8ea664
|
||||
autoCheck: true
|
||||
autoCheckInterval: 5
|
||||
|
||||
Reference in New Issue
Block a user