How to define that all parameters in openapi schema are required? [duplicate] - swagger

I have an answer with 40 fields. I need to specify that all fields are required.
Option to list all fields
required: [field1,field2,field3 ..... field40]
Maybe there is an option to indicate that ALL fields of the answer are required.
For example allOf ?

required: [field1, field2, ..., field40] is the only way. There are no shortcuts.

Related

Add types in the parameter table when generating document with Stardoc

We are trying to use Stardoc when generating documentation for our Bazel macros.
I can get a table generated with parameter descriptions when follow the instruction here:
Macro/Function documenatation.
But we would also like to add the parameter Type in the table.
According to DocstringUtils.java it seems like we shall write the type in parentheses after the parameter name but before colon, as this example:
another_parameter (unused, mutable): a parameter may be followed
by additional attributes in parenthese
I have seen that it's possible to add a rule template to the stardoc() rule (attribute: func_template).
I started to use an own copy of the default template to play around with: //stardoc:templates/markdown_tables/func.vm
If I have understood correctly it doesn't seem that the attributes that I add in paranthese is fetched.
And I don't think that I will be able to retreive that information by just updating the template.
So I think that it will need an update in the Stardoc code for this, correct?!
Is that something that is already planned?
If I'm not correct then I would appreciate information how I can retreive the value of the attribute.
Thanks!
Best Regards
Elisabeth

Zapier form dynamic inputFields manipulation

I'd like to manipulate the input fields of a trigger form dynamically:
I have a trigger 'hidden' with a combo-box in a form
Each time I update the combo, it should add one or more combo-boxes in the same form depending on the value
I couldn't find any way to access the operation.inputFields somewhere for doing an update on this list dynamically, whether via the bundle or else...
Here is the small example: https://github.com/nuxeo-sandbox/nuxeo-zapier/blob/spikes-NXP-26085-zapier/nuxeo-zapier-app/triggers/project.js#L8-L16
Thank you for your help!
Vlad
David here, from the Zapier Platform team.
It sounds like you're looking for Custom Fields: https://github.com/zapier/zapier-platform-cli#customdynamic-fields
In addition to a static list of input fields, you can provide a function that will run and provide a dynamic set of fields. It's how we get inputs for each column in a google sheet:
Is that what you're asking? Modifying the inputFields array at runtime probably doesn't do what you want.

Ruby-on-Rails: Can enum value be a string. Where is this documented?

Can someone point me to some ROR documentation that describes setting the value of an enum as a string? All the documentation and examples I've found seem to indicate that the value should be an integer. However I am able to create an enum with string values, use it in view and save it to the database without any issues. I would really like to find out more on this topic.
Example that works
Set in ModelName
enum category_enum: { 'abc efg'=> 'alpha', 'hot dog' => 'bun' }
Set in view
<%= f.select :category, ModelName.category_enums %>
I didn't find any documentation and didn't confirm the behaviour myself, however a pull request was merged into Rails in November 2013 and the description from the contributor Yury is:
Allow to pass explicit mapping values to enum...I don't strict values to integers, so if needed, strings can be used. (source: https://github.com/rails/rails/pull/12747)
So it appears this is indeed supported.

Excluding fields in Dozer mapping

Is there a way to exclude multiple fields in Dozer, when source and target classes are the same?
I am using it like this:
<mapping map-null="false" wildcard="true">
<class-a>com.abc</class-a>
<class-b>com.abc</class-b>
<field-exclude>
<a>field1</a>
<b>field1</b>
</field-exclude>
<field-exclude>
<a>field2</a>
<b>field2</b>
</field-exclude> ....
</mapping>
It seems so funny to write same name when it's known that it'll always be same for all... Is there any alternative?
I found this post in Google, but I configure Dozer via annotations so the existing answer didn't help me.
In order to exclude a field from mapping via annotations use
#Mapping("this") on the field.
Source: Dozer, how to ignore a field with annotation
wildcard="false"
will do the trick.
http://dozer.sourceforge.net/documentation/exclude.html

Checkbox and Yes/No ASP.Net-Jquery

I have a page where it populates questions. There are two types of questions.
First one Yes/No,
Second one multiple choice with checkboxes. The multiple choices varies from 2- 5.
Depending on the question I need to generate a string which can be used in aspx.cs file
The format of string is :
string value="1=true, 2=false,3=false,4= true"
if 1 and 4 options are selected(checkbox options).
The string format for Yes/No would be
string value= "1=false, 2= false, 3=false,4=false"
Could any body help me how To do this using jquery in asp.net
Thank you
Hari
Have you checked out serialize? http://api.jquery.com/serialize/

Resources