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

Fix that a property's custom model can take a description #17

Closed
sergiobayona opened this issue May 15, 2024 · 1 comment · Fixed by #26
Closed

Fix that a property's custom model can take a description #17

sergiobayona opened this issue May 15, 2024 · 1 comment · Fixed by #26
Assignees
Labels
bug Something isn't working

Comments

@sergiobayona
Copy link
Owner

    class Routes
      include EasyTalk::Model

      def self.name
        'system_routes'
      end

      define_schema do
        property :name, String, description: 'The name of the route'
        property :path, String, description: 'The path to the route'
        property :parameters, Params, description: 'The parameters for the route' # <-- description does not appear in the json schema
        property :title, String, description: 'A short description of the conversation'
      end
    end
@sergiobayona sergiobayona self-assigned this May 15, 2024
@sergiobayona sergiobayona added the bug Something isn't working label May 15, 2024
@sergiobayona
Copy link
Owner Author

prop = Propery.new(:name, custom_class, title: 'Custom Class', description: 'some description').as_json

calls type.schema which returns the schema of custom_class

see https://github.com/sergiobayona/easy_talk/blob/main/lib/easy_talk/property.rb#L87

ignoring the outer scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant