@@ -35,6 +35,28 @@ if (url) {
3535 fs . writeFileSync ( file , JSON . stringify ( openApi , null , 2 ) )
3636 process . stdout . write ( 'DONE\n' )
3737
38+ try {
39+ // temporary fix for UIComponent schema in OpenAPI spec - see https://github.com/openhab/openhab-core/issues/5686
40+ process . stdout . write ( `Updating UIComponent in ${ file } ... ` )
41+ execSync ( `jq '.components.schemas.UIComponent = input' ${ file } ./build/UIComponent.json > tmp.json && mv tmp.json ${ file } ` , {
42+ stdio : 'ignore'
43+ } )
44+ process . stdout . write ( 'DONE\n' )
45+ } catch ( updateError ) {
46+ process . stderr . write ( 'ERROR updating UIComponent:' , updateError )
47+ }
48+
49+ try {
50+ // temporary fix for RootUIComponent schema in OpenAPI spec - see https://github.com/openhab/openhab-core/issues/5686
51+ process . stdout . write ( `Updating RootUIComponent in ${ file } ... ` )
52+ execSync ( `jq '.components.schemas.RootUIComponent = input' ${ file } ./build/RootUIComponent.json > tmp.json && mv tmp.json ${ file } ` , {
53+ stdio : 'ignore'
54+ } )
55+ process . stdout . write ( 'DONE\n' )
56+ } catch ( updateError ) {
57+ process . stderr . write ( 'ERROR updating RootUIComponent:' , updateError )
58+ }
59+
3860 try {
3961 process . stdout . write ( `Applying oxfmt to ${ file } ... ` )
4062 execSync ( `oxfmt ${ file } ` , { stdio : 'ignore' } )
@@ -44,17 +66,15 @@ if (url) {
4466 }
4567}
4668
47- if ( file && ! openApi ) {
48- process . stdout . write ( `Reading OpenAPI spec from file ${ file } ... ` )
49- try {
50- const data = fs . readFileSync ( file , 'utf8' )
51- openApi = JSON . parse ( data )
52- } catch ( error ) {
53- process . stderr . write ( 'ERROR reading OpenAPI spec from file:' , error )
54- process . exit ( 1 )
55- }
56- process . stdout . write ( 'DONE\n' )
69+ process . stdout . write ( `Reading OpenAPI spec from file ${ file } ... ` )
70+ try {
71+ const data = fs . readFileSync ( file , 'utf8' )
72+ openApi = JSON . parse ( data )
73+ } catch ( error ) {
74+ process . stderr . write ( 'ERROR reading OpenAPI spec from file:' , error )
75+ process . exit ( 1 )
5776}
77+ process . stdout . write ( 'DONE\n' )
5878
5979try {
6080 await createClient ( {
0 commit comments