Skip to content

Installation and use docs #24

@gbosetti

Description

@gbosetti

Hello and congrats for your project! It seems you are pioneering openapi in Smalltalk :) I would like to try to use your project for both, generating the docs and generating the API code in Smalltalk. Just in case, do you have some base guidelines to generate the code? This is what I did right now (it could be useful for the readme if you think it can help other developers):

  1. Use Iceberg to load the repo. It is simpler via https
  2. Click on the repo > Metacello > Install baseline
  3. You can check the tests, or you can set up a server from the Playground with the example API, and check it from your Web browser:

server := ZnServer startOn: 1700 + 10 atRandom.
server delegate:
(ZnRestServerDelegate new
uriSpace: ( OpenAPIUriSpace new
rootClass: OpenAPICall;
yourself )).

Pet instances add: (Pet new id: 1; name: 'a'; age: 1).
Pet instances add: (Pet new id: 2; name: 'a'; age: 2).

server localUrl. // e.g. Visit http://localhost:1710/pets/01

  1. If you want to load your own OpenAPI specification, lets say:
    fileContent := '{ "openapi": "3.0.0", ...}'.

You can do it by loading from a string:
api := OpenAPI fromString: fileContent.

Bue then... I couldn't find the way to generate the supporting classes (e.g. Pet, OpenAPISpecCall, etc). Or is it something we should manually create?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions