Publication d'un fichier de définition d'API REST

Vous pouvez déployer un projet Web sur un serveur Liberty. Vous pouvez afficher dans un navigateur Web le fichier de définition d'API (interface de programmation) publié.

Avant de commencer

Spécifiez votre API REST en créant un fichier swagger.json. Pour plus d'informations sur la création d'un fichier swagger.json, voir Création d'un fichier de définition d'API REST.

Pourquoi et quand exécuter cette tâche

Important : Applicable à Liberty, Liberty Core

Procédure

  1. Configurez le fichier server.xml pour permettre à l'environnement d'exécution de rechercher le fichier swagger.json.

    Pour plus d'informations sur la configuration du fichier server.xml, voir Including configuration information from external xml files in the server.xml file.

  2. Démarrez le serveur Liberty.

    Pour plus d'informations sur le démarrage d'un serveur Liberty, voir Démarrage et arrêt d'un serveur avec les outils de développement.

  3. Dans la vue Serveurs, cliquez avec le bouton droit de la souris sur le serveur Liberty et sélectionnez Ajout et suppression.
  4. Sélectionnez votre projet Web, cliquez sur Ajouter, puis sur Terminer.
  5. Pour afficher le fichier de définition d'API REST, ouvrez une fenêtre de navigateur et accédez à https://localhost:9443/ibm/api/explorer/.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: last_date

File name: t_restapi_publish.html