Returned in the jsonapi field with every response. See http://jsonapi.org/format/#document-top-level.
160982
public void putServerInfo(String key, String value) {
        serverInfo.put(key, value);

        moduleRegistry.setServerInfo(serverInfo);
    }
254252
def get_documents(self):
        
        return self.session.query(Document).order_by(Document.name).all()
831716
@GET
  @Path("rawtext/{top}/{docname}")
  @Produces(MediaType.APPLICATION_XML)
  public RawTextWrapper getRawText(@PathParam("top") String top,
    @PathParam("docname") String docname)
  {
    Subject user = SecurityUtils.getSubject();
    user.checkPermission("query:raw_text:" + top);

    RawTextWrapper result = new RawTextWrapper();
    result.setTexts(queryDao.getRawText(top, docname));
    return result;
  }
274122
def _parse_resource(self, resource):
        

        link = 'jsonapi.org/format/#document-resource-objects'
        rid = isinstance(resource.get('id'), unicode)
        rtype = isinstance(resource.get('type'), unicode)

        if not rtype or (self.req.is_patching and not rid):
            self.fail('JSON API requires that every resource object MUST '
                      'contain a `type` top-level key. Additionally, when '
                      'modifying an existing resource object an `id` '
                      'top-level key is required. The values of both keys '
                      'MUST be strings. Your request did not comply with '
                      'one or more of these 3 rules', link)
        elif 'attributes' not in resource and 'relationships' not in resource:
            self.fail('Modifiying or creating resources require at minimum '
                      'an attributes object and/or relationship object.', link)
        elif rid and self.req.is_posting:
            abort(exceptions.ModificationDenied(**{
                'detail': 'Our API does not support client-generated ID\'s '
                          'when creating NEW resources. Instead, our API '
                          'will generate one for you & return it in the '
                          'response.',
                'links': 'jsonapi.org/format/#crud-creating-client-ids',
            }))
724220
protected long getRevisionIdFromResponse(JsonNode response) throws JsonMappingException {
		if(response == null) {
			throw new JsonMappingException("API response is null");
		}
		JsonNode entity = null;
		if(response.has("entity")) {
			entity = response.path("entity");
		} else if(response.has("pageinfo")) {
			entity = response.path("pageinfo");
		} 
		if(entity != null && entity.has("lastrevid")) {
			return entity.path("lastrevid").asLong();
		}
		throw new JsonMappingException("The last revision id could not be found in API response");
	}
1074223
def to_api_repr(self):
        
        # Put together the basic representation. See http://bit.ly/2hOAT5u.
        answer = {
            "mode": self.mode.upper(),
            "name": self.name,
            "type": self.field_type.upper(),
            "description": self.description,
        }

        # If this is a RECORD type, then sub-fields are also included,
        # add this to the serialized representation.
        if self.field_type.upper() == "RECORD":
            answer["fields"] = [f.to_api_repr() for f in self.fields]

        # Done; return the serialized dictionary.
        return answer
415495
def _response_value(self, response, json=True):
        
        if json:
            contentType = response.headers.get("Content-Type", "")
            if not contentType.startswith(("application/json",
                                           "text/javascript")):
                if response.status_code == 200:
                    raise CloudStackException(
                        "JSON (application/json) was expected, got {!r}"
                        .format(contentType),
                        response=response)

                raise CloudStackException(
                    "HTTP {0.status_code} {0.reason}"
                    .format(response),
                    "Make sure endpoint URL {!r} is correct."
                    .format(self.endpoint),
                    response=response)

            try:
                data = response.json()
            except ValueError as e:
                raise CloudStackException(
                    "HTTP {0.status_code} {0.reason}"
                    .format(response),
                    "{0!s}. Malformed JSON document".format(e),
                    response=response)

            [key] = data.keys()
            data = data[key]
        else:
            data = response.text

        if response.status_code != 200:
            raise CloudStackException(
                "HTTP {0} response from CloudStack".format(
                    response.status_code),
                data,
                response=response)

        return data
735040
public static List<Annotation> getMetaDataDoc(String toplevelCorpusName,
    String documentName)
  {
    List<Annotation> result = new ArrayList<Annotation>();
    WebResource res = Helper.getAnnisWebResource();
    try
    {
      res = res.path("meta").path("doc")
        .path(urlPathEscape.escape(toplevelCorpusName));
      res = res.path(urlPathEscape.escape(documentName));

      result = res.get(new GenericType<List<Annotation>>()
      {
      });
    }
    catch (UniformInterfaceException | ClientHandlerException ex)
    {
      log.error(null, ex);
      if(!AnnisBaseUI.handleCommonError(ex, "retrieve metadata"))
      {
        Notification.show(
          "Remote exception: " + ex.getLocalizedMessage(),
          Notification.Type.WARNING_MESSAGE);
      }
    }
    return result;
  }
549104
def get_all_response(self, sort_order=None, sort_target='key',
                         keys_only=False):
        """"""
        range_request = self._build_get_range_request(
            key=b'\0',
            range_end=b'\0',
            sort_order=sort_order,
            sort_target=sort_target,
            keys_only=keys_only,
        )

        return self.kvstub.Range(
            range_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
305514
def format_response(self, data):
        
        self.count = self.max_count

        return OrderedDict([
            ('highest_count', self.max_count),
            ('overall_total', self.total),
            ('next', self.get_next_link()),
            ('previous', self.get_previous_link()),
            ('results', data)
        ])
1308322
protected function doCall()
    {
        $this->resolveOptions();
        $this->request = $this->createRequest();
        $this->response = $this->client->send($this->request);

        return $this->generateResponse($this->response);
    }
286126
function() {
				var doc = this;
				var stack = [];

				_.forEach(model.$oids, function(fkType, schemaPath) {
					if (fkType.type == 'subDocument') return; // Skip sub-documents (as they are stored against the parent anyway)

					stack = stack.concat(doc.getNodesBySchemaPath(schemaPath)
						.map(function(node) {
							node.fkType = fkType.type;
							return node;
						})
					);
				});
				return stack;
			}
476779
def get_response(self):
        
        res = IODWriteRes()
        for field in ["seqNum", "ARUUID", "API", "slotNumber",
                      "subslotNumber", "index"]:
            res.setfieldval(field, self.getfieldval(field))
        return res
300470
def read_json(self):
        
        with reading_ancillary_files(self):
            metadata = super(GenericLayerMetadata, self).read_json()

        return metadata
311722
def _docs(self):
        
        iterdocs = iter(self.docs())
        first = next(iterdocs)
        needs_parsing = False
        if isinstance(first, six.string_types):
            needs_parsing = True
        elif isinstance(first, dict):
            pass
        else:
            raise RuntimeError('Document must be either JSON strings or dict.')
        for doc in itertools.chain([first], iterdocs):
            if needs_parsing:
                doc = json.loads(doc)
            if '_index' not in doc:
                doc['_index'] = self.index
            if '_type' not in doc:
                doc['_type'] = self.doc_type
            yield doc
610828
def getSerializedResponse(self):
        
        self._protoObject.next_page_token = pb.string(self._nextPageToken)
        s = protocol.toJson(self._protoObject)
        return s
696271
def documents(self, full=False):
        ''''''
        url = self.base_url + self.DOCUMENTS_PAGE
        class_ = Document
        results = self._retrieve_resources(url, class_, full)
        return results