Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page s'applique à Apigee et à Apigee hybrid.
À propos des spécifications d'API
Les spécifications d'API utilisent des formats standards pour décrire les API. Elles sont lisibles par une machine, mais sont également faciles à lire et à comprendre pour les humains. Les spécifications décrivent généralement les éléments d'une API, tels que son chemin de base, ses chemins et verbes, en-têtes, paramètres de requête, opérations, types de contenus, descriptions de réponse, etc., comme illustré dans la Figure 1.
Figure 1. Extrait d'une spécification OpenAPI.
Une version d'API peut contenir plusieurs spécifications d'API du même type ou de types différents, telles que Spécification OpenAPI, Proto et WSDL. Lorsque cela est possible, le hub d'API peut analyser une spécification d'API afin d'extraire et stocker les métadonnées de l'API, telles que l'ID de l'API, l'ID de la version, la description et les opérations. Consultez la section Analyse des spécifications.
Utiliser des spécifications d'API avec le hub d'API
Vous pouvez créer une version d'API dans le hub d'API avec ou sans spécification d'API.
Vous pouvez importer une spécification au moment où vous créez une version. Lorsque vous affichez les détails d'une API dans l'interface utilisateur, vous voyez la liste de toutes les spécifications associées aux versions d'une ressource d'API.
Vous pouvez également créer et configurer une version avec une spécification à l'aide de l'API REST. Lorsque vous utilisez l'API, vous créez une entité de version d'API avec la spécification, puis vous pouvez associer la version à une ressource d'API.
Lorsque cela est possible, le hub d'API peut analyser une spécification d'API afin d'extraire des informations sur l'API et les stocker avec une version d'API. Par exemple, le hub d'API peut analyser une spécification d'API OpenAPI pour extraire et stocker l'ID de l'API, l'ID de la version, la description, les opérations et d'autres métadonnées.
Le hub d'API est également compatible avec la validation des spécifications. Consultez la section Valider une spécification d'API.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eAPI specifications are standardized, machine-readable formats that describe APIs, including elements like paths, verbs, headers, and response descriptions.\u003c/p\u003e\n"],["\u003cp\u003eAPI hub allows the creation of API versions both with and without an API specification, which can be uploaded during version creation or added later using the REST API.\u003c/p\u003e\n"],["\u003cp\u003eAPI hub can parse API specifications, such as OpenAPI, to extract and store API metadata, including the API ID, version ID, description, and operations.\u003c/p\u003e\n"],["\u003cp\u003eAPI hub supports the validation of API specifications, and specification parsing is only available for OpenAPI specifications versions 2.0, 3.0 and 3.1 in both JSON and YAML formats.\u003c/p\u003e\n"]]],[],null,["# Introduction to API specifications\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\nAbout API specifications\n------------------------\n\nAPI specifications use standard formats to describe APIs. They are machine readable, but also\neasy for humans to read and understand. Specifications typically describe elements of an API\nsuch as its base path, paths and verbs, headers, query parameters, operations, content types,\nresponse descriptions, and so on, as shown in Figure 1.\n\n**Figure 1.** Excerpt from an OpenAPI specification.\n\nAn [API version](./versions-intro) can contain multiple API specifications of the same or different types such as\n[OpenAPI Spec](https://swagger.io/specification/), Proto, and WSDL. Where supported, API hub can parse an API specification to extract and store\nAPI metadata, such as the API ID, version ID, description, and operations. See [Specification parsing](#specificationparsing).\n\nUsing API specifications with API hub\n-------------------------------------\n\nYou can create an API version in API hub with or without an API specification.\n\nYou can upload a specification\nat the time you create a version. When you view details of an API in the user interface, you will\nsee a list of any specs that are associated with the versions of an API resource.\n\nYou can also create and configure a version with a specification using the REST API. When\nusing the API, you create an API version entity with the specification, then you can attach the version\nto an API resource.\n\nFor more information, see [Add a spec to a version](./manage-specifications#addspec).\n\nSpecification parsing\n---------------------\n\nWhere supported, API hub can parse an API specification to extract information about the API\nand store it with an API version. For example, API hub can parse an API OpenAPI specification to extract and store\nthe API ID, version ID, description, operations, and other metadata.\n\n\nAPI hub also supports specification validation. See [Validate an API specification](./validate-spec).\n\n| **Note:** API specification parsing is only supported for [OpenAPI specifications](https://swagger.io/specification/) (v.2.0, v3.0 and v3.1) in JSON and YAML formats."]]