Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method with a list in result having the "object" type in the generated spec #18

Open
svetlyak40wt opened this issue Oct 17, 2023 · 0 comments

Comments

@svetlyak40wt
Copy link
Member

For example, for this code:

(uiop:define-package #:foo
  (:use #:cl))
(in-package #:foo)

(openrpc-server:define-api (test))

(openrpc-server:define-rpc-method (test foo) ()
  (:result list)
  (list "foo" "bar"))

this spec is generated:

FOO> (openrpc-server/discovery:generate-spec test)
(SERAPEUM:DICT
  "methods" '((SERAPEUM:DICT
                "name" "foo"
                "params" #()
                "result" (SERAPEUM:DICT
                           "name" "foo_result"
                           "schema" (SERAPEUM:DICT
                                      "type" "object"
                                      "properties" (SERAPEUM:DICT
                                                    )
                                      "required" #()
                                      "x-cl-class" "LIST"
                                      "x-cl-package" "COMMON-LISP"
                                     )
                          )
                "paramStructure" "by-name"
               ) )
  "openrpc" "1.0.0"
  "info" (SERAPEUM:DICT
           "title" "Default API"
           "version" "0.1.0"
          )
  "servers" '((SERAPEUM:DICT
                "name" "default"
                "url" "http://localhost:5000/"
               ) )
 ) 

but result should have schema with type = array.

Note, I've created this PR which adds generate-spec function used in the example: #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant