{
  "openapi": "3.0.1",
  "info": {
    "title": "Eesti Geoloogiateenistuse uuringute register",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "version": "1.0.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://fond.egt.ee/fond"
    }
  ],
  "paths": {
    "/egf-api/{egfnr}": {
      "get": {
        "operationId": "study",
        "summary": "Study data",
        "deprecated": true,
        "parameters": [
          {
            "name": "egfnr",
            "in": "path",
            "description": "EGF code",
            "required": true,
            "style": "simple",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudyV1"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/egf-api": {
      "get": {
        "operationId": "studies",
        "summary": "All studies",
        "deprecated": true,
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StudyV1"
                  }
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/egf-api/{egfnr}": {
      "get": {
        "summary": "Study data",
        "operationId": "studyV1",
        "tags": [
          "api-v1"
        ],
        "parameters": [
          {
            "name": "egfnr",
            "in": "path",
            "description": "EGF code",
            "required": true,
            "style": "simple",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StudyV1"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/egf-api/": {
      "get": {
        "summary": "All studies",
        "operationId": "studiesV1",
        "tags": [
          "api-v1"
        ],
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StudyV1"
                  }
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v2/egf-api/{egfnr}": {
      "get": {
        "summary": "Study data",
        "operationId": "studyV2",
        "tags": [
          "api-v2"
        ],
        "parameters": [
          {
            "name": "egfnr",
            "in": "path",
            "description": "EGF code",
            "required": true,
            "style": "simple",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Uuring"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v2/egf-api": {
      "get": {
        "operationId": "studiesV2",
        "summary": "All studies",
        "tags": [
          "api-v2"
        ],
        "responses": {
          "200": {
            "description": "Study",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Uuring"
                  }
                }
              }
            }
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StudyV1": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32",
            "nullable": false
          },
          "DOI": {
            "type": "string"
          },
          "creator": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "title_orig": {
            "type": "string"
          },
          "title_eng": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "description": "RFC3339 date-fullyear"
          },
          "tags": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "deposit": {
            "type": "string"
          },
          "deposit_code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "min_resource": {
            "type": "string"
          },
          "funder": {
            "type": "string"
          },
          "performer": {
            "type": "string"
          },
          "emk_protocol": {
            "type": "string"
          },
          "epvk_protocol": {
            "type": "string"
          },
          "restricted_untill": {
            "type": "string",
            "format": "date"
          },
          "restricted_reason": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "geometry": {
            "type": "object",
            "description": "GeoJSON geometry format: https://tools.ietf.org/html/rfc7946#section-3.1"
          },
          "geoLocations": {
            "type": "object",
            "description": "DOI data format: https://schema.datacite.org/meta/kernel-4.2/metadata.xsd; element \"geoLocations\" structure"
          }
        }
      },
      "Uuring": {
        "type": "object",
        "properties": {
          "egf_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false
          },
          "doi": {
            "type": "string"
          },
          "autor": {
            "type": "string"
          },
          "nimetus": {
            "type": "string"
          },
          "nimetus_orig": {
            "type": "string"
          },
          "nimetus_eng": {
            "type": "string"
          },
          "aasta": {
            "type": "integer",
            "format": "int32"
          },
          "votmesona": {
            "type": "string"
          },
          "valdkond": {
            "type": "string"
          },
          "maardla": {
            "type": "string"
          },
          "maardla_reg": {
            "type": "string"
          },
          "kokkuvote": {
            "type": "string"
          },
          "maavara": {
            "type": "string"
          },
          "tellija": {
            "type": "string"
          },
          "teostaja": {
            "type": "string"
          },
          "piirang": {
            "type": "string",
            "description": "Piiratud or Piiratud osaliselt"
          },
          "piirangu_andmed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PiirangAndmed"
            }
          },
          "avalik_markus": {
            "type": "string"
          },
          "ruumikuju": {
            "type": "object",
            "description": "GeoJSON geometry format: https://tools.ietf.org/html/rfc7946#section-3.1"
          },
          "geoLocation": {
            "type": "object",
            "description": "DOI data format: https://schema.datacite.org/meta/kernel-4.2/metadata.xsd; element \"geoLocations\" structure"
          },
          "siffer": {
            "type": "string"
          },
          "max_sygav": {
            "type": "number"
          },
          "ehitusgeo_uuringu_liik": {
            "type": "string"
          },
          "keel": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "up_arv": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "teim_maht": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "pinnas": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "muudetud": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PiirangAndmed": {
        "type": "object",
        "properties": {
          "piiratud_kuni": {
            "type": "string",
            "format": "date"
          },
          "piirangu_pohjus": {
            "type": "string"
          }
        }
      }
    },
    "links": {},
    "callbacks": {}
  },
  "security": []
}