Skip to content

Commit bbe0c87

Browse files
committed
breaking change: all comment annotations are using snake case only
1 parent c8e457b commit bbe0c87

11 files changed

Lines changed: 89 additions & 168 deletions

NpgsqlRest/Defaults/DefaultCommentParser.cs

Lines changed: 52 additions & 131 deletions
Large diffs are not rendered by default.

NpgsqlRestTests/BodyTests/BodyParameterNameTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ create function body_param_name_1p(_p text)
99
returns text language sql as 'select _p';
1010
comment on function body_param_name_1p(text) is '
1111
HTTP
12-
body-param-name p
12+
body_param_name p
1313
';
1414
1515
create function body_param_name_2p(_i int, _p text)
1616
returns text language sql as 'select _i::text || '' '' || _p';
1717
comment on function body_param_name_2p(int, text) is '
1818
HTTP
19-
body-param-name _p
19+
body_param_name _p
2020
';
2121
2222
create function body_param_name_int(_int int)
2323
returns text language sql as 'select _int';
2424
comment on function body_param_name_int(int) is '
2525
HTTP
26-
body-param-name int';
26+
body_param_name int';
2727
");
2828
}
2929
}

NpgsqlRestTests/CommentTests/CommentAuthAttrTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ comment on function comment_authorize1() is 'HTTP
1111
1212
create function comment_authorize2() returns text language sql as 'select ''authorize2''';
1313
comment on function comment_authorize2() is 'HTTP
14-
RequiresAuthorization';
14+
requires_authorization';
1515
1616
create function comment_authorize3() returns text language sql as 'select ''authorize3''';
1717
comment on function comment_authorize3() is '

NpgsqlRestTests/CommentTests/CommentParamTypeAttrTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ public static void CommentParamTypeAttrTests()
88
create function comment_param_type_query1(_t text) returns text language sql as 'select _t';
99
comment on function comment_param_type_query1(text) is '
1010
HTTP
11-
RequestParamType QueryString
11+
request_param_type query_string
1212
';
1313
1414
create function comment_param_type_query2(_t text) returns text language sql as 'select _t';
1515
comment on function comment_param_type_query2(text) is '
1616
HTTP
17-
ParamType Query
17+
param_type query
1818
';
1919
2020
create function comment_get_param_type_json1(_t text) returns text language sql as 'select _t';
2121
comment on function comment_get_param_type_json1(text) is '
2222
HTTP
23-
RequestParamType BodyJson
23+
request_param_type body_json
2424
';
2525
2626
create function comment_get_param_type_json2(_t text) returns text language sql as 'select _t';
2727
comment on function comment_get_param_type_json2(text) is '
2828
HTTP
29-
ParamType Json
29+
param_type BODY
3030
';
3131
");
3232
}

NpgsqlRestTests/ConnectionNameTests/ConnectionNameTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ from pg_stat_activity
2323
where pid = pg_backend_pid();
2424
$$;
2525
26-
comment on function get_conn1_connection_name() is 'ConnectionName conn1';
26+
comment on function get_conn1_connection_name() is 'connection_name conn1';
2727
2828
create function get_conn2_connection_name()
2929
returns text
@@ -34,7 +34,7 @@ from pg_stat_activity
3434
where pid = pg_backend_pid();
3535
$$;
3636
37-
comment on function get_conn2_connection_name() is 'ConnectionName conn2';
37+
comment on function get_conn2_connection_name() is 'connection_name conn2';
3838
3939
create function get_conn3_connection_name()
4040
returns text
@@ -45,7 +45,7 @@ from pg_stat_activity
4545
where pid = pg_backend_pid();
4646
$$;
4747
48-
comment on function get_conn3_connection_name() is 'ConnectionName conn3';
48+
comment on function get_conn3_connection_name() is 'connection_name conn3';
4949
");
5050
}
5151
}

NpgsqlRestTests/ConnectionNameTests/ConnectionNameUsingParamsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ from pg_stat_activity
3636
where pid = pg_backend_pid();
3737
$$;
3838
39-
comment on function get_conn3_connection_name_p() is 'connection-name=conn3';
39+
comment on function get_conn3_connection_name_p() is 'connection_name=conn3';
4040
");
4141
}
4242
}

NpgsqlRestTests/NullHandlingTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@ public static void NullHandlingTests()
99
create function get_null1() returns text language sql as 'select null';
1010
1111
create function get_null2() returns text language sql as 'select null';
12-
comment on function get_null2() is 'response-null-handling emptystring';
12+
comment on function get_null2() is 'response_null_handling empty_string';
1313
1414
create function get_null3() returns text language sql as 'select null';
15-
comment on function get_null3() is 'response-null-handling nullliteral';
15+
comment on function get_null3() is 'response_null_handling null_literal';
1616
1717
create function get_null4() returns text language sql as 'select null';
18-
comment on function get_null4() is 'response-null-handling nocontent';
18+
comment on function get_null4() is 'response_null_handling no_content';
1919
2020
create function get_nullable_param1(_t text) returns text language sql as 'select _t';
21-
comment on function get_nullable_param1(text) is 'response-null-handling nocontent';
21+
comment on function get_nullable_param1(text) is 'response_null_handling no_content';
2222
2323
create function get_nullable_param2(_t text) returns text language sql as 'select _t';
2424
comment on function get_nullable_param2(text) is '
25-
response-null-handling nocontent
26-
query-string-null-handling ignore
25+
response_null_handling no_content
26+
query_string_null_handling ignore
2727
';
2828
2929
create function get_nullable_param3(_t text) returns text language sql as 'select _t';
3030
comment on function get_nullable_param3(text) is '
31-
response-null-handling nocontent
32-
query-string-null-handling EmptyString
31+
response_null_handling no_content
32+
query_string_null_handling empty_string
3333
';
3434
3535
create function get_nullable_param4(_t text) returns text language sql as 'select _t';
3636
comment on function get_nullable_param4(text) is '
37-
response-null-handling nocontent
38-
query-string-null-handling NullLiteral
37+
response_null_handling no_content
38+
query_string_null_handling null_literal
3939
';
4040
""");
4141
}

NpgsqlRestTests/RawContentTests/RawDownloadTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ select sub.*
2323
comment on function header_template_response1(text, text) is '
2424
raw
2525
separator ,
26-
newline \n
26+
new_line \n
2727
Content-Type: {_type}
2828
Content-Disposition: attachment; filename={_file}
2929
';
@@ -45,7 +45,7 @@ select sub.*
4545
comment on function header_template_response2(text, text) is '
4646
raw
4747
separator ,
48-
newline \n
48+
new_line \n
4949
Content-Type: {type}
5050
Content-Disposition: attachment; filename={file}
5151
';

NpgsqlRestTests/RawContentTests/RawResponseTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ select sub.*
5353
comment on function raw_csv_separators_response1() is '
5454
raw
5555
separator ,
56-
newline \n
56+
new_line \n
5757
Content-Type: text/csv
5858
';
5959
@@ -73,7 +73,7 @@ select sub.*
7373
comment on function raw_csv_separators_with_headers_response1() is '
7474
raw
7575
separator ,
76-
newline \n
76+
new_line \n
7777
column_names
7878
Content-Type: text/csv
7979
';

NpgsqlRestTests/RawContentTests/RawResponseUsingParamsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ select sub.*
7272
$$;
7373
comment on function raw_csv_separators_with_headers_response2() is '
7474
raw=true
75-
raw-separator=,
75+
raw_separator=,
7676
raw_new_line=\n
7777
column_names=true
7878
Content-Type: text/csv

0 commit comments

Comments
 (0)