Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-948

Defining new api with yaml file: setting publicAPI or publicServer to true does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.2.2.Final, 1.2.x
    • None
    • None
    • None

    Description

      I'm using Apiman 1.2.1 on Wildfly 9, and the latest version of apiman-cli (d22e6ea). I'm using this simple yaml:

      system:
        gateways: []
        plugins: []
      org:
        name: "myorg"
        description: "myorg descr"
        apis:
          - name: "someapi4"
            description: "someapi descr"
            initialVersion: "1.0"
            published: true
            config:
              endpoint: "${myApiEndPoint}"
              endpointType: "rest"
              #note the following line:
              publicAPI: true
              gateway: "TheGateway"
            policies: []
      

      and use it with:

      ./apiman apply --server http://localhost:8080/apiman -f ../apiman_settings.yml -P myApiEndPoint=http://myapi:8080/ --serverVersion v12x
      

      The api is created, but not set public (checkbox on "Make this API public" is not set). Publishing therefore fails, with a stacktrace:

      INFO  Loaded declaration: ../apiman_settings.yml
      INFO  Org already exists: myorg
      INFO  API already exists: someapi4
      INFO  Configuring API: someapi4
      ERROR Error in Apply declaration
      io.apiman.cli.exception.CommandException: Error applying declaration
              at io.apiman.cli.core.declarative.command.ApplyCommand.performAction(ApplyCommand.java:105) ~[apiman-cli.jar:?]
              at io.apiman.cli.command.AbstractCommand.run(AbstractCommand.java:126) [apiman-cli.jar:?]
              at io.apiman.cli.command.AbstractCommand.run(AbstractCommand.java:155) [apiman-cli.jar:?]
              at io.apiman.cli.Cli.main(Cli.java:37) [apiman-cli.jar:?]
      Caused by: io.apiman.cli.exception.DeclarativeException: Unable to publish API 'someapi4' in state: Created
              at io.apiman.cli.core.declarative.command.ApplyCommand.publish(ApplyCommand.java:401) ~[apiman-cli.jar:?]
              at io.apiman.cli.core.declarative.command.ApplyCommand.lambda$null$27(ApplyCommand.java:235) ~[apiman-cli.jar:?]
              at java.util.ArrayList.forEach(ArrayList.java:1249) ~[?:1.8.0_71]
              at io.apiman.cli.core.declarative.command.ApplyCommand.lambda$applyApis$28(ApplyCommand.java:222) ~[apiman-cli.jar:?]
              at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_71]
              at io.apiman.cli.core.declarative.command.ApplyCommand.applyApis(ApplyCommand.java:219) ~[apiman-cli.jar:?]
              at io.apiman.cli.core.declarative.command.ApplyCommand.lambda$applyDeclaration$17(ApplyCommand.java:138) ~[apiman-cli.jar:?]
              at java.util.Optional.ifPresent(Optional.java:159) ~[?:1.8.0_71]
              at io.apiman.cli.core.declarative.command.ApplyCommand.applyDeclaration(ApplyCommand.java:124) ~[apiman-cli.jar:?]
              at io.apiman.cli.core.declarative.command.ApplyCommand.performAction(ApplyCommand.java:103) ~[apiman-cli.jar:?]
              ... 3 more
      

      Note that I've used publicAPI, as found in io.apiman.cli.core.api.model.ApiConfig, instead of publicService as still mentioned in the README.md. (Using publicService doesn't work either.)

      Attachments

        Activity

          People

            outofcoffee_jira Pete Cornish (Inactive)
            ewittman@redhat.com Eric Wittmann
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: