Skip to content

Instantly share code, notes, and snippets.

View amaralrfl's full-sized avatar

Rafael Amaral amaralrfl

View GitHub Profile
@amaralrfl
amaralrfl / ServeRest.postman_collection.json
Created September 7, 2021 20:43
Collection criada para ser utilizada no exemplo de validação de JSON Schema no Postman com o ServeRest
{
"info": {
"_postman_id": "5e73b0b1-ff8b-4f12-a38b-d159afb7c242",
"name": "ServeRest",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "/produtos",
"event": [
@amaralrfl
amaralrfl / serveRest_product_list_schema_full.json
Created September 3, 2021 20:11
JSON Schema completo da lista de produtos do ServeRest Raw
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"quantidade": 229,
@amaralrfl
amaralrfl / serveRest_product_list_schema_compact.json
Created September 3, 2021 20:10
JSON Schema reduzido da lista de produtos do ServeRest
{
"type": "object",
"required": [
"quantidade",
"produtos"
],
"properties": {
"quantidade": {
"type": "integer",
"default": 0
@amaralrfl
amaralrfl / RestAssuredSample.java
Last active September 9, 2019 21:44
Class to show the use of Rest Assured using Get Method
package sample;
import org.json.simple.JSONObject;
import org.testng.annotations.Test;
import static io.restassured.RestAssured.given;
import static io.restassured.RestAssured.when;
import static io.restassured.RestAssured.get;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.CoreMatchers.containsString;
@amaralrfl
amaralrfl / jsonSchemaSample.py
Last active July 29, 2018 19:07
Classe exemplo de uso do json schema com python
from jsonschema import validate
schema = {
"title": "Person",
"type": "object",
"required": [ "firstName", "lastName" ],
"properties": {
"firstName": {
"type": "string"
},
@amaralrfl
amaralrfl / RestAssuredTest.java
Last active July 29, 2018 02:15
Class to configure and try run Rest Assured
import org.testng.annotations.Test;
import static io.restassured.RestAssured.get;
import static io.restassured.RestAssured.given;
import static org.hamcrest.core.IsEqual.equalTo;
public class RestAssuredTest {
String url = "https://reqres.in/api/users";
@Test
@amaralrfl
amaralrfl / pom.xml
Last active July 29, 2018 01:30
Rest Assured Tutorial
<dependencies>
<!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>