anchor.diff:          (json:as-object-member ("tags")
             (json:with-array ()
               (loop for resource being the hash-values of (rs::resources api)
  -               do
  -                 (json:as-array-member ()
  -                   (json:with-object ()
  -                     (@= "name" (string (rs:resource-name resource)))
  -                     (@= "description" (rs:resource-documentation resource)))))))
  +                  do
  +                     (json:as-array-member ()
  +                       (json:with-object ()
  +                         (@= "name" (string (rs:resource-name resource)))
  +                         (@= "description" (rs:resource-documentation resource)))))))
           (json:as-object-member ("paths")
             (json:with-object ()
               (loop for path being the hash-keys of (api-paths api)
  -               using (hash-value operations)
  -               do (encode-api-path path operations)))
  +                    using (hash-value operations)
  +                  do (encode-api-path path operations)))
             )))))
   
   (defun encode-api-path (path operations)
     (json:as-object-member (path)
       (json:with-object ()
         (loop for spec in operations do
  -           (let ((tag (getf spec :tag))
  -                 (operation (getf spec :operation)))
  -             (json:as-object-member ((string-downcase (string (rs::request-method operation))))
  -               (json:with-object ()
  -                 (json:encode-object-member "tags" (list (string tag)))
  -                 (json:encode-object-member "summary" (rs::api-documentation operation))
  -                 (json:encode-object-member "description" (rs::api-documentation operation))
  -                 (json:encode-object-member "operationId" (rs::name operation))
  -                 (json:as-object-member ("parameters")
  -                   (json:with-array ()
  -                     (loop for arg in (rs::required-arguments operation)
  +        (let ((tag (getf spec :tag))
  +              (operation (getf spec :operation)))
  +          (json:as-object-member ((string-downcase (string (rs::request-method operation))))
  +            (json:with-object ()
  +              (json:encode-object-member "tags" (list (string tag)))
  +              (json:encode-object-member "summary" (rs::api-documentation operation))
  +              (json:encode-object-member "description" (rs::api-documentation operation))
  +              (json:encode-object-member "operationId" (rs::name operation))
  +              (json:as-object-member ("parameters")
  +                (json:with-array ()
  +                  (loop for arg in (rs::required-arguments operation)
                           do (json:as-array-member ()
                                (encode-path-parameter arg :in "path")))
  -                     (loop for arg in (rs::optional-arguments operation)
  +                  (loop for arg in (rs::optional-arguments operation)
                           do (json:as-array-member ()
                                (encode-path-parameter arg :in "query")))
  -                     ))
  -                 )))))))
  +                  ))
  +              )))))))
   
   (defun encode-path-parameter (param &key (in "query"))
     (json:with-object ()
  
positive.code: (defpackage rs.openapi
    (:use :rest-server :cl)
    (:export :define-api-from-spec
             :define-schemas-from-spec
             :export-api-spec))
  
  (in-package :rs.openapi)
  
negative.code: 1) All operations in OpenAPI spec need to have a tag, in camel case, that is translated to a REST-SERVER api operation. For example: 'createUser', gets translated to CREATE-USER entry point in REST-SERVER api.
  2) Operations in OpenAPI spec need to be tagged with a name for the resource. This is because REST-SERVER is designed based on an old version of Swagger API that groups operations in resources. But OpenAPI v3 does not group in resources, it just has paths. So, the tagging is needed for the OpenAPI -> REST-SERVER api translation. For example, if you have two paths, /invoice/{id}, and /invoice/{id}/payments, you should tag them both with 'Invoice', so that both operations are created under an INVOICE resource.
  
  Use this together with DEFINE-SCHEMAS-FROM-SPEC
  "
    (let ((spec (read-spec-file filepath)))
      (define-api-from-v3-spec name superclasses options spec)))
  