Skip to content

Instantly share code, notes, and snippets.

View ioggstream's full-sized avatar

Roberto Polli ioggstream

View GitHub Profile
openapi: 3.0.3
info:
title: API Sistema Gestione Deleghe (SGD)
version: '1.0.0'
description: This document contains the specification for the SGD API
termsOfService: https://deleghedigitali.gov.it/tos
contact:
name: Istituto Poligrafico e Zecca dello Stato (IPZS)
url: https://deleghedigitali.gov.it
email: tech@deleghedigitali.gov.it
extends:
- https://italia.github.io/api-oas-checker/spectral-full.yml
rules:
oas3-unused-components-schema: false
oas3-api-servers: false
@ioggstream
ioggstream / argocd-5-minutes.sh
Last active February 17, 2022 12:19
ArgoCD in 5 minutes
# Install argocd CLI.
wget https://github.com/argoproj/argo-cd/releases/download/v2.2.5/argocd-linux-amd64 -O ~/.local/bin/argocd && chmod +x ~/.local/bin/argocd
# Run a minikube instance.
export CLUSTER_NAME="test-argocd"
minikube start --profile "${CLUSTER_NAME}"
# Deploy argocd in the `argocd` ns.
kubectl create namespace argocd
@ioggstream
ioggstream / interface-specification.yml
Created February 15, 2022 10:02
Interoperability API Gateway Micro Service
openapi: 3.0.3
info:
title: Interoperability API Gateway Micro Service
description: defines the persistence operations for the agreement
version: '0.1.0'
contact:
name: API Support
url: 'http://www.example.com/support'
email: support@example.com
termsOfService: 'http://swagger.io/terms/'
@ioggstream
ioggstream / test-tollboth-ratelimit.sh
Last active February 8, 2022 14:19
Test tollboth ratelimit implementation
cat > main.go <<EOF
package main
import (
"github.com/didip/tollbooth/v6"
"net/http"
)
func HelloHandler(w http.ResponseWriter, req *http.Request) {
w.Write([]byte("Hello, World!"))
openapi: 3.0.1
paths:
/oauth:
post:
description: Use x-noqa to skip this check
responses:
"200": {}
"400":
x-noqa: RFC6749
content:
import random
from faker import Faker
from codicefiscale import codicefiscale as fiscalcode
from codicefiscale.data import _MUNICIPALITIES as italian_municipalities
import string
italian_municipalities_active = [
x for x in italian_municipalities if "soppresso" not in str(x)
]
@ioggstream
ioggstream / show-properties-by-type.yaml
Created February 2, 2022 22:50
A sample schema for testing the semantic catalog
openapi: 3.0.1
components:
schemas:
Person:
# When you reference a rdf:type, the UI shows all related properties
x-jsonld-type: https://w3id.org/italia/onto/CPV/Person
paths: {}
info:
@ioggstream
ioggstream / .spectral.yml
Created January 11, 2022 21:39
Spectral validation file for PDND APIs - Draft
# This is a custom API ruleset to accomodate the PDND APIs:
# see below the changes.
# It is based on the ruleset published by the API OAS Checker project.
extends:
- spectral:oas
- https://italia.github.io/api-oas-checker/spectral-full.yml
rules:
# The priority of the following rules is lowered to `hint`
# because they are not capable of checking whether a global
@ioggstream
ioggstream / deleteme-semantic-api.yaml
Created January 10, 2022 18:23
An API with ontology endpoints.
#
# Questo e' un progetto d'esempio in formato OpenAPI 3.0 API Starter Kit.
#
# Stai per sviluppare un API? Segui attentamente questo template e
# potrai integrarla facilmente in Developers Italia.
#
# Se usi componenti in modo ricorrente, yaml
# permette di definirle e riusarle.
# Puoi metterle nell'oggetto x-commons e rimuoverlo
# prima di pubblicarle.