Skip to content

Commit

Permalink
v2 returns hidden flag and moderator_actions with photos and sounds; …
Browse files Browse the repository at this point in the history
…spec fix
  • Loading branch information
pleary committed Feb 26, 2024
1 parent 41fcf0b commit bc1ea61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions openapi/schema/response/photo.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
const Joi = require( "joi" );
const flag = require( "./flag" );
const moderatorAction = require( "./moderator_action" );

module.exports = Joi.object( ).keys( {
id: Joi.number( ).integer( )
.description( "Unique auto-increment integer identifier." )
.required( ),
attribution: Joi.string( ),
flags: Joi.array( ).items( flag ),
hidden: Joi.boolean( ),
large_url: Joi.string( ).valid( null ),
license_code: Joi.string( ).valid( null ),
medium_url: Joi.string( ).valid( null ),
moderator_actions: Joi.array( ).items( moderatorAction ),
native_page_url: Joi.string( ).valid( null ),
native_photo_id: Joi.string( ).valid( null ),
original_dimensions: Joi.object( ).keys( {
Expand Down
3 changes: 3 additions & 0 deletions openapi/schema/response/sound.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const Joi = require( "joi" );
const flag = require( "./flag" );
const moderatorAction = require( "./moderator_action" );

module.exports = Joi.object( ).keys( {
attribution: Joi.string( ),
file_content_type: Joi.string( ),
file_url: Joi.string( ),
flags: Joi.array( ).items( flag ),
hidden: Joi.boolean( ),
id: Joi.number( ).integer( ).description( "Unique auto-increment integer identifier." ).required( ),
license_code: Joi.string( ).valid( null ),
moderator_actions: Joi.array( ).items( moderatorAction ),
native_sound_id: Joi.string( ).valid( null )
} ).unknown( false ).meta( { className: "Sound" } )
.valid( null );
2 changes: 1 addition & 1 deletion test/integration/v2/observations.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ describe( "Observations", ( ) => {
it( "should include a relevant listed taxon", function ( done ) {
const o = fixtures.elasticsearch.observations.observation[0];
const railsResponse = {
conservation_status: {},
conservation_status: null,
listed_taxon: {
id: 1,
establishment_means_label: "introduced"
Expand Down

0 comments on commit bc1ea61

Please sign in to comment.