phacks / notion-ruby-client

A Ruby client for the Notion API
MIT License
122 stars 26 forks source link

query validation error in GET /page/:id endpoint #2

Closed H0R15H0 closed 3 years ago

H0R15H0 commented 3 years ago

Hello. Thank you very much for developing the gem for Notion's API, which has just been released to the public. Now, I found a bug in the method that retrieves the page. This is the error with how to reproduce it.

> require './lib/notion-ruby-client'
> client = Notion::Client.new(token: 'NOTION_API_TOKEN')
> client.page(id: "PAGE_ID")
Traceback (most recent call last):
       16: from /usr/local/bin/irb:23:in `load'
       15: from /usr/local/lib/ruby/gems/2.7.0/gems/irb-1.2.6/exe/irb:11:in `<top (required)>'
       14: from (irb):4
       13: from /app/lib/notion/api/endpoints/pages.rb:19:in `page'
       12: from /app/lib/notion/faraday/request.rb:6:in `get'
       11: from /app/lib/notion/faraday/request.rb:28:in `request'
       10: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/connection.rb:198:in `get'
        9: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/connection.rb:494:in `run_request'
        8: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/rack_builder.rb:154:in `build_response'
        6: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/request/url_encoded.rb:25:in `call'
        5: from /app/lib/notion/faraday/response/raise_error.rb:24:in `call'
        4: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/middleware.rb:18:in `call'
        3: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/response.rb:59:in `on_complete'
        2: from /usr/local/bundle/gems/faraday-1.4.2/lib/faraday/middleware.rb:19:in `block in call'
        1: from /app/lib/notion/faraday/response/raise_error.rb:20:in `on_complete'
Notion::Api::Errors::NotionError (query failed validation: query.archived should be not present, instead was `0`. )

I'm sorry for my poor English, but I would appreciate it if someone could check this issue.

hummusonrails commented 3 years ago

Hi, @H0R15H0,

Thank you for both raising the issue, and for contributing a pull request. I am going to review it shortly.

Ben

H0R15H0 commented 3 years ago

Hi, @bencgreenberg, Thank you for your quick response! Sho