1
0
Fork 0
Commit graph

287 commits

Author SHA1 Message Date
Cyborus 48eee70c88
fix errors/warnings in generated code
remove import of `Write`
remove now unused output string in display impls
access query fields by reference
remove `r#` in vars accessed in format strings
replace char literals in write macros with strings
2024-01-24 16:31:34 -05:00
Cyborus bcfe3e1e6c Merge pull request 'autogen improvements' (#39) from Aviac/forgejo-api:aviac/autogen into autogen
Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/39
2024-01-24 21:04:50 +00:00
aviac 5cabd12eb6
fix(mistake): order of statements
Authored-by: Aviac <aviac@mailbox.org>
2024-01-24 21:43:03 +01:00
aviac a7299ab841
fix(list): adjust broken generated code
Authored-by: Aviac <aviac@mailbox.org>
2024-01-23 09:31:55 +01:00
aviac a680fd9212
chore(cleanup): remove comment
Authored-by: Aviac <aviac@mailbox.org>
2024-01-23 09:23:46 +01:00
aviac 9566d232bf
feat(formatting): auto run rustfmt on generated file
Authored-by: Aviac <aviac@mailbox.org>
2024-01-22 09:21:46 +01:00
aviac 32b6a3d110
chore(cleanup): consolidate writelns
Authored-by: Aviac <aviac@mailbox.org>
2024-01-22 09:11:24 +01:00
aviac 1b6cd3467a
feat(definitions): impl Display
Instead of adding a `to_string` method on each definition struct, this
commit implements `Display`. This shouldn't result in any breaking
changes since the trait also exposes a method with the same name.

I also tried to format the generated text here and there to make it more
readable in the generate code base as well as in the generate text.

Authored-by: Aviac <aviac@mailbox.org>
2024-01-22 09:01:09 +01:00
aviac 331bb80acf
fix(typo?): remove weird line
Authored-by: Aviac <aviac@mailbox.org>
2024-01-22 09:01:09 +01:00
Cyborus 37db499785
replace hook type with gitea
makes tests on forgejo development branches pass
2024-01-21 17:07:11 -05:00
Cyborus 26303fc1f8
put test repo in current dir instead of root 2024-01-21 16:05:15 -05:00
Cyborus 8d3738af50
special-case ssh_url to not be a url::Url 2024-01-21 16:03:44 -05:00
Cyborus 996c722f90
support returning header values 2024-01-21 16:03:11 -05:00
Cyborus 99ae09c8d3
format format format 2024-01-19 12:21:06 -05:00
Cyborus 63c6dc9f7f
fix http methods 2024-01-18 18:15:09 -05:00
Cyborus 194a1b5e36
handle datetime (de)serialization 2024-01-18 18:10:05 -05:00
Cyborus bfb31fc296
add trailing slash to api prefix 2024-01-18 17:53:11 -05:00
Cyborus ec3a9e74c4
strip leading slash
a leading slash causes `url::Url` to replace the entire existing path
2024-01-18 17:45:03 -05:00
Cyborus 83c236a02f
restructure tests 2024-01-18 17:16:52 -05:00
Cyborus ac25339cf6
formatting 2024-01-18 16:51:09 -05:00
Cyborus 6d2c1ce21c
update tests to new api 2024-01-18 16:48:18 -05:00
Cyborus cfd12a6306
add additional properties support 2024-01-18 16:27:05 -05:00
Cyborus d9f51681df
add back download_release_attachment 2024-01-18 15:45:47 -05:00
Cyborus 1c57c2d70b
derive PartialEq for generated structs 2024-01-18 14:54:11 -05:00
Cyborus 6ee958ce86
simpler error handling 2024-01-18 14:48:31 -05:00
Cyborus 81b17abc8a
replace with generated api 2024-01-18 13:44:07 -05:00
Cyborus 77b390575a
rename userGetOauth2Application to userGetOAuth2Applications 2024-01-18 13:41:48 -05:00
Cyborus 92c913c457
make generated fields public 2024-01-16 19:13:45 -05:00
Cyborus a0fbf64fce
put structs in a module 2024-01-16 19:10:27 -05:00
Cyborus c83eecc7ff
praise rustfmt 2024-01-16 18:59:46 -05:00
Cyborus 61e24b800d
guess which types are url by field name 2024-01-16 18:55:19 -05:00
Cyborus 53922bc465
make *Query::to_string take self 2024-01-16 18:38:24 -05:00
Cyborus 0565c3f1c6
remove unnecessary enumeration 2024-01-16 18:38:02 -05:00
Cyborus ed1092bc9e
use OffsetDateTime::format instead of format_into 2024-01-16 18:37:31 -05:00
Cyborus 9bd1a137b8
use write! instead of .write_fmt 2024-01-16 18:36:50 -05:00
Cyborus f8bbf570e1
RequestBuilder::json takes reference, doesn't return result 2024-01-16 18:20:17 -05:00
Cyborus fed24b52ec
only check 200 responses for if optional 2024-01-16 18:18:38 -05:00
Cyborus edf4646953
add derives to generated structs 2024-01-16 18:15:38 -05:00
Cyborus 70b4081cde
simple recursion prevention 2024-01-16 18:09:13 -05:00
Cyborus 2859fd132e
add missing arg to UnexpectedStatusCode 2024-01-16 18:03:44 -05:00
Cyborus 2f60a92933
add type parameters to serde_json::Map 2024-01-16 17:49:00 -05:00
Cyborus b111e3352d
convert to snake case inside of sanitize_ident 2024-01-16 17:29:32 -05:00
Cyborus 41c710281d
sanitize body arg 2024-01-16 17:27:03 -05:00
Cyborus 4c7ec23ab7
impl on crate::Forgejo instead of Forgejo 2024-01-16 17:23:51 -05:00
Cyborus c17c1f8638
generate query structs 2024-01-16 17:23:02 -05:00
Cyborus f30b4eba30
autogenerate structs 2024-01-16 14:01:37 -05:00
Cyborus 12f2800b26
convert path args to camel case in format string 2024-01-16 13:07:28 -05:00
Cyborus 20a58df856
methods should be pub and async 2024-01-16 12:51:30 -05:00
Cyborus 3d12246cb8
import ForgejoError in generated file 2024-01-16 12:50:35 -05:00
Cyborus 769521840e
add method generation 2024-01-16 00:09:22 -05:00