telegram-bot-ruby icon indicating copy to clipboard operation
telegram-bot-ruby copied to clipboard

Upgrade to API 7.10

Open seorgiy opened this issue 1 year ago • 1 comments

Also i tried to parse json schema from https://ark0f.github.io/tg-bot-api/openapi.json and build some parser (new rake tasks). It's not ideal in the many ways but it's something

seorgiy avatar Oct 11 '24 09:10 seorgiy

Hey @seorgiy

Looks really nice, much better than parsing their docs. I'll take a deeper look this weekend. Also we need to make linter pass (not sure why it fails)

atipugin avatar Oct 11 '24 09:10 atipugin

Hey, @atipugin, gentle reminder 🙄

seorgiy avatar Nov 12 '24 20:11 seorgiy

Hey @seorgiy

Sorry for the delay, could you update this PR also up to 7.11?

atipugin avatar Nov 16 '24 06:11 atipugin

Done

seorgiy avatar Nov 16 '24 07:11 seorgiy

Yeah, thanks!

But we still need to figure out what to do with specs. We use type_attributes.yml in types_spec.rb to ensure our Ruby classes have all required attributes. I don't really want to keep both openai_type_attributes.json and type_attributes.yml. I think we need to rewrite tests to use JSON file instead.

I'm also not sure that spec/support is the correct place for openapi_type_attributes.json and type.rb, because these files are used to generate stuff, not just for specs. I'd move JSON file to top-level data dir or something. I'd also split rake tasks and move it rakelib. But we could do it later, outside this PR. The first thing is to make specs work with JSON file

What do you think, @seorgiy?

atipugin avatar Nov 16 '24 15:11 atipugin

@atipugin hey! I have improved the typebuilder, now it is fully automatic, except for the methods added to the classes. Introduced min/max constraints.

Unfortunately, I am very bad at writing tests. But now it turns out that we are testing the generated classes against the generated schema. Looks not really useful to me. Still i made simple fresh file at least for basic attributes compare.

Also tweaked structure a little, removed old parser, tasks moved to rakelib, take a look.

(too tired to fight linter right now 😪 )

seorgiy avatar Nov 17 '24 14:11 seorgiy

@atipugin ok, not it's more or less readable. PR is looks kinda messy right now which im sorry for but it's working fine

seorgiy avatar Nov 18 '24 16:11 seorgiy

@seorgiy GJ, man! Thanks for updating up to 8.0. Minor request - please set version to 2.1, because otherwise we have to make corresponding releases (2.1, 2.2, 2.3) based on your changelog. Let's just stick with 2.1 here

atipugin avatar Nov 24 '24 12:11 atipugin

@atipugin done

seorgiy avatar Nov 24 '24 13:11 seorgiy

Thanks! Merged!

atipugin avatar Nov 24 '24 14:11 atipugin